extract BacklightApplet, add brightness and notif pills to lock screen right column
This commit is contained in:
parent
a55d232b9a
commit
08d34ac5c7
5 changed files with 163 additions and 79 deletions
79
shell/applets/BacklightApplet.qml
Normal file
79
shell/applets/BacklightApplet.qml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
import QtQuick
|
||||
import "../services" as S
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property int percent
|
||||
required property color accentColor
|
||||
|
||||
signal setPercent(real pct)
|
||||
|
||||
implicitHeight: 36
|
||||
|
||||
Text {
|
||||
id: _icon
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "\uF185"
|
||||
color: root.accentColor
|
||||
font.pixelSize: S.Theme.fontSize + 2
|
||||
font.family: S.Theme.iconFontFamily
|
||||
}
|
||||
|
||||
Item {
|
||||
id: _slider
|
||||
anchors.left: _icon.right
|
||||
anchors.leftMargin: 8
|
||||
anchors.right: _label.left
|
||||
anchors.rightMargin: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: 6
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: S.Theme.base02
|
||||
radius: 3
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width * root.percent / 100
|
||||
height: parent.height
|
||||
color: root.accentColor
|
||||
radius: 3
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: 80
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -6
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => _set(mouse)
|
||||
onPositionChanged: mouse => {
|
||||
if (pressed)
|
||||
_set(mouse);
|
||||
}
|
||||
function _set(mouse) {
|
||||
root.setPercent(mouse.x / _slider.width * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: _label
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: root.percent + "%"
|
||||
color: S.Theme.base05
|
||||
font.pixelSize: S.Theme.fontSize
|
||||
font.family: S.Theme.fontFamily
|
||||
width: 30
|
||||
}
|
||||
}
|
||||
|
|
@ -6,3 +6,4 @@ CpuApplet 1.0 CpuApplet.qml
|
|||
MemoryApplet 1.0 MemoryApplet.qml
|
||||
TemperatureApplet 1.0 TemperatureApplet.qml
|
||||
DiskApplet 1.0 DiskApplet.qml
|
||||
BacklightApplet 1.0 BacklightApplet.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue