forked from Shinonome/dots-hyprland
hefty: bar: battery: checkmark when full, more natural order for vertical
This commit is contained in:
@@ -104,6 +104,7 @@ HBarWidgetWithPopout {
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: (parent.height - height) / 2
|
bottomMargin: (parent.height - height) / 2
|
||||||
}
|
}
|
||||||
|
rotation: 180 * root.vertical
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
W.MaterialSymbol {
|
W.MaterialSymbol {
|
||||||
@@ -111,24 +112,26 @@ HBarWidgetWithPopout {
|
|||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.leftMargin: -2
|
Layout.leftMargin: -2
|
||||||
Layout.rightMargin: -2
|
Layout.rightMargin: -2
|
||||||
rotation: 90 * root.vertical
|
rotation: -90 * root.vertical
|
||||||
fill: 1 * (text == "bolt")
|
fill: 1 * (text == "bolt")
|
||||||
fillAnimation: null
|
fillAnimation: null
|
||||||
text: {
|
text: {
|
||||||
|
if (batteryProgress.value == 1)
|
||||||
|
return "check";
|
||||||
if (root.chargingAndNotFull)
|
if (root.chargingAndNotFull)
|
||||||
return "bolt";
|
return "bolt";
|
||||||
if (root.powerSaving)
|
if (root.powerSaving)
|
||||||
return "nest_eco_leaf";
|
return "nest_eco_leaf";
|
||||||
return "circle";
|
return "";
|
||||||
}
|
}
|
||||||
iconSize: C.Appearance.font.pixelSize.small
|
iconSize: C.Appearance.font.pixelSize.small
|
||||||
font.weight: Font.DemiBold
|
font.weight: Font.DemiBold
|
||||||
visible: root.chargingAndNotFull || root.powerSaving
|
visible: text != ""
|
||||||
}
|
}
|
||||||
W.VisuallyCenteredStyledText {
|
W.VisuallyCenteredStyledText {
|
||||||
visible: batteryProgress.value < 1
|
visible: batteryProgress.value < 1
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
rotation: 90 * root.vertical
|
rotation: -90 * root.vertical
|
||||||
font: batteryProgress.font
|
font: batteryProgress.font
|
||||||
text: batteryProgress.text
|
text: batteryProgress.text
|
||||||
}
|
}
|
||||||
@@ -164,6 +167,7 @@ HBarWidgetWithPopout {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
W.CircularProgress {
|
W.CircularProgress {
|
||||||
|
id: battCircProg
|
||||||
implicitSize: 44
|
implicitSize: 44
|
||||||
lineWidth: 3
|
lineWidth: 3
|
||||||
value: S.Battery.percentage
|
value: S.Battery.percentage
|
||||||
@@ -173,6 +177,8 @@ HBarWidgetWithPopout {
|
|||||||
fill: 1
|
fill: 1
|
||||||
animateChange: true
|
animateChange: true
|
||||||
text: {
|
text: {
|
||||||
|
if (battCircProg.value == 1)
|
||||||
|
return "check";
|
||||||
if (root.chargingAndNotFull)
|
if (root.chargingAndNotFull)
|
||||||
return "bolt";
|
return "bolt";
|
||||||
if (root.powerSaving)
|
if (root.powerSaving)
|
||||||
|
|||||||
Reference in New Issue
Block a user