2025-12-21 20:59:33 +01:00
|
|
|
import Quickshell.Services.UPower
|
|
|
|
|
import QtQuick
|
|
|
|
|
import Quickshell.Widgets
|
2025-12-28 13:25:31 +01:00
|
|
|
import "../../"
|
|
|
|
|
import "../settings/"
|
2025-12-31 11:04:34 +01:00
|
|
|
import QtQuick.Layouts
|
2025-12-21 20:59:33 +01:00
|
|
|
|
2025-12-31 11:04:34 +01:00
|
|
|
Rectangle {
|
2025-12-21 20:59:33 +01:00
|
|
|
id: root
|
2025-12-31 11:04:34 +01:00
|
|
|
visible: UPower.displayDevice.isLaptopBattery
|
|
|
|
|
color: "transparent"
|
|
|
|
|
implicitWidth: masterLayout.implicitWidth + 10
|
|
|
|
|
implicitHeight: 34
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: masterLayout
|
2025-12-21 20:59:33 +01:00
|
|
|
anchors.centerIn: parent
|
2025-12-31 11:04:34 +01:00
|
|
|
spacing: 0
|
|
|
|
|
Row {
|
|
|
|
|
spacing: 5
|
|
|
|
|
Text {
|
|
|
|
|
id: topText
|
|
|
|
|
font.weight: 900
|
|
|
|
|
font.family: Settings.font
|
|
|
|
|
font.pixelSize: Settings.fontSize
|
|
|
|
|
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
|
|
|
|
color: Colors.foreground
|
|
|
|
|
}
|
|
|
|
|
IconImage {
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
source: "root:/icons/" + UPower.displayDevice.iconName + ".svg"
|
|
|
|
|
width: 12
|
|
|
|
|
height: 12
|
|
|
|
|
}
|
2025-12-21 20:59:33 +01:00
|
|
|
}
|
|
|
|
|
Text {
|
2025-12-31 11:04:34 +01:00
|
|
|
id: botText
|
2025-12-22 13:55:00 +01:00
|
|
|
font.weight: 900
|
2025-12-28 13:25:31 +01:00
|
|
|
font.family: Settings.font
|
|
|
|
|
font.pixelSize: Settings.fontSize
|
2025-12-21 20:59:33 +01:00
|
|
|
color: Colors.foreground
|
2025-12-31 11:04:34 +01:00
|
|
|
text: UPower.displayDevice.nativePath
|
2025-12-21 20:59:33 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|