forked from Shinonome/dots-hyprland
hefty: bar: fix popup displaying wrong value
This commit is contained in:
@@ -147,7 +147,7 @@ HBarWidgetWithPopout {
|
|||||||
W.CircularProgress {
|
W.CircularProgress {
|
||||||
implicitSize: 46
|
implicitSize: 46
|
||||||
lineWidth: 3
|
lineWidth: 3
|
||||||
value: S.Battery.health / 100
|
value: S.Battery.percentage
|
||||||
W.MaterialSymbol {
|
W.MaterialSymbol {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
iconSize: 22
|
iconSize: 22
|
||||||
@@ -164,17 +164,21 @@ HBarWidgetWithPopout {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 0
|
spacing: 0
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: S.Battery.knownEnergyRate
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 4
|
spacing: 4
|
||||||
W.StyledText {
|
W.StyledText {
|
||||||
Layout.alignment: Qt.AlignBaseline
|
Layout.alignment: Qt.AlignBaseline
|
||||||
|
visible: S.Battery.knownEnergyRate
|
||||||
text: F.DateUtils.formatDuration(S.Battery.isCharging ? S.Battery.timeToFull : S.Battery.timeToEmpty)
|
text: F.DateUtils.formatDuration(S.Battery.isCharging ? S.Battery.timeToFull : S.Battery.timeToEmpty)
|
||||||
font.pixelSize: C.Appearance.font.pixelSize.title
|
font.pixelSize: C.Appearance.font.pixelSize.title
|
||||||
}
|
}
|
||||||
W.StyledText {
|
W.StyledText {
|
||||||
Layout.alignment: Qt.AlignBaseline
|
Layout.alignment: Qt.AlignBaseline
|
||||||
text: S.Battery.isCharging ? S.Translation.tr("to full") : S.Translation.tr("remaining")
|
text: {
|
||||||
|
if (!S.Battery.knownEnergyRate)
|
||||||
|
return S.Battery.isCharging ? S.Translation.tr("Charging") : S.Translation.tr("Discharging");
|
||||||
|
return S.Battery.isCharging ? S.Translation.tr("to full") : S.Translation.tr("remaining");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user