forked from Shinonome/dots-hyprland
Wrong position and forgot an import
This commit is contained in:
@@ -63,7 +63,28 @@ StyledPopup {
|
|||||||
text: Battery.isCharging ? Translation.tr("Time to full:") : Translation.tr("Time to empty:")
|
text: Battery.isCharging ? Translation.tr("Time to full:") : Translation.tr("Time to empty:")
|
||||||
color: Appearance.colors.colOnSurfaceVariant
|
color: Appearance.colors.colOnSurfaceVariant
|
||||||
}
|
}
|
||||||
RowLayout {
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
color: Appearance.colors.colOnSurfaceVariant
|
||||||
|
text: {
|
||||||
|
function formatTime(seconds) {
|
||||||
|
var h = Math.floor(seconds / 3600);
|
||||||
|
var m = Math.floor((seconds % 3600) / 60);
|
||||||
|
if (h > 0)
|
||||||
|
return `${h}h, ${m}m`;
|
||||||
|
else
|
||||||
|
return `${m}m`;
|
||||||
|
}
|
||||||
|
if (Battery.isCharging)
|
||||||
|
return formatTime(Battery.timeToFull);
|
||||||
|
else
|
||||||
|
return formatTime(Battery.timeToEmpty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
spacing: 5
|
spacing: 5
|
||||||
visible: Config.options.battery.showHealth
|
visible: Config.options.battery.showHealth
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -86,26 +107,6 @@ StyledPopup {
|
|||||||
text: `${(Battery.health).toFixed(1)}%`
|
text: `${(Battery.health).toFixed(1)}%`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
color: Appearance.colors.colOnSurfaceVariant
|
|
||||||
text: {
|
|
||||||
function formatTime(seconds) {
|
|
||||||
var h = Math.floor(seconds / 3600);
|
|
||||||
var m = Math.floor((seconds % 3600) / 60);
|
|
||||||
if (h > 0)
|
|
||||||
return `${h}h, ${m}m`;
|
|
||||||
else
|
|
||||||
return `${m}m`;
|
|
||||||
}
|
|
||||||
if (Battery.isCharging)
|
|
||||||
return formatTime(Battery.timeToFull);
|
|
||||||
else
|
|
||||||
return formatTime(Battery.timeToEmpty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Quickshell
|
|||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import qs.modules.common.functions
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|||||||
Reference in New Issue
Block a user