added battery widget on qs
This commit is contained in:
@@ -3,29 +3,21 @@ import QtQuick.Layouts
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
|
|
||||||
Item {
|
RowLayout {
|
||||||
id: root
|
|
||||||
// enabled: uPowerExists
|
|
||||||
width: content.width
|
|
||||||
height: content.height
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
RowLayout {
|
|
||||||
id: content
|
id: content
|
||||||
height: 20
|
height: 20
|
||||||
anchors.centerIn: root
|
anchors.centerIn: root
|
||||||
Rectangle {
|
Rectangle {
|
||||||
height: text.height
|
implicitHeight: text.height
|
||||||
width: text.width
|
implicitWidth: text.width
|
||||||
color: Colors.backgroundAlt
|
color: Colors.backgroundAlt
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Text {
|
Text {
|
||||||
property int power: UPower.displayDevice.percentage * 100
|
|
||||||
|
|
||||||
id: text
|
id: text
|
||||||
|
property int power: UPower.displayDevice.percentage * 100
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: power
|
text: power + "%"
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user