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