add logic to only display bat module when its a laptop battery
This commit is contained in:
parent
232ada5fae
commit
734c41f6f2
@ -3,29 +3,42 @@ import QtQuick
|
|||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import "../../"
|
import "../../"
|
||||||
import "../settings/"
|
import "../settings/"
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Item {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
implicitWidth: batRow.implicitWidth + 10
|
visible: UPower.displayDevice.isLaptopBattery
|
||||||
implicitHeight: batRow.implicitHeight
|
color: "transparent"
|
||||||
Row {
|
implicitWidth: masterLayout.implicitWidth + 10
|
||||||
id: batRow
|
implicitHeight: 34
|
||||||
|
ColumnLayout {
|
||||||
|
id: masterLayout
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 5
|
spacing: 0
|
||||||
IconImage {
|
Row {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
spacing: 5
|
||||||
source: "root:/icons/" + UPower.displayDevice.iconName + ".svg"
|
Text {
|
||||||
width: 12
|
id: topText
|
||||||
height: 12
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: batteryText
|
id: botText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
font.weight: 900
|
font.weight: 900
|
||||||
font.family: Settings.font
|
font.family: Settings.font
|
||||||
font.pixelSize: Settings.fontSize
|
font.pixelSize: Settings.fontSize
|
||||||
color: Colors.foreground
|
color: Colors.foreground
|
||||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
text: UPower.displayDevice.nativePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user