25 lines
573 B
QML
25 lines
573 B
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Services.UPower
|
|
|
|
RowLayout {
|
|
id: content
|
|
height: 20
|
|
anchors.centerIn: root
|
|
Rectangle {
|
|
implicitHeight: text.height
|
|
implicitWidth: text.width
|
|
color: Colors.backgroundAlt
|
|
Layout.alignment: Qt.AlignCenter
|
|
radius: 3.5
|
|
Text {
|
|
id: text
|
|
property int power: UPower.displayDevice.percentage * 100
|
|
anchors.centerIn: parent
|
|
text: power + "%"
|
|
color: Colors.textPrimary
|
|
}
|
|
}
|
|
}
|