mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix battery icon on LockScreen
This commit is contained in:
@@ -87,6 +87,7 @@ Loader {
|
||||
property bool isReady: initializationComplete && BatteryService.batteryReady
|
||||
property real percent: BatteryService.batteryPercentage
|
||||
property bool charging: BatteryService.batteryCharging
|
||||
property bool pluggedIn: BatteryService.batteryPluggedIn
|
||||
property bool batteryVisible: isReady && percent > 0 && BatteryService.hasAnyBattery()
|
||||
}
|
||||
|
||||
@@ -279,9 +280,13 @@ Loader {
|
||||
Keys.onPressed: function (event) {
|
||||
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
||||
lockContext.tryUnlock();
|
||||
event.accepted = true;
|
||||
}
|
||||
if (event.key === Qt.Key_Escape && panelComponent.timerActive) {
|
||||
panelComponent.cancelTimer();
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: forceActiveFocus()
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ Item {
|
||||
visible: batteryIndicator.isReady && BatteryService.hasAnyBattery()
|
||||
|
||||
NIcon {
|
||||
icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.isReady)
|
||||
icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.pluggedIn, batteryIndicator.isReady)
|
||||
pointSize: Style.fontSizeM
|
||||
color: batteryIndicator.charging ? Color.mPrimary : Color.mOnSurfaceVariant
|
||||
}
|
||||
@@ -457,7 +457,7 @@ Item {
|
||||
visible: batteryIndicator.isReady && BatteryService.hasAnyBattery()
|
||||
|
||||
NIcon {
|
||||
icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.isReady)
|
||||
icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.pluggedIn, batteryIndicator.isReady)
|
||||
pointSize: Style.fontSizeM
|
||||
color: batteryIndicator.charging ? Color.mPrimary : Color.mOnSurfaceVariant
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ NBox {
|
||||
NIcon {
|
||||
icon: {
|
||||
var b = BluetoothService.getBatteryPercent(modelData);
|
||||
return BatteryService.getIcon(b !== null ? b : 0, false, b !== null);
|
||||
return BatteryService.getIcon(b !== null ? b : 0, false, false, b !== null);
|
||||
}
|
||||
pointSize: Style.fontSizeXS
|
||||
color: getContentColor(Color.mOnSurface)
|
||||
@@ -347,7 +347,7 @@ NBox {
|
||||
NIcon {
|
||||
icon: {
|
||||
var b = BluetoothService.getBatteryPercent(modelData);
|
||||
return BatteryService.getIcon(b !== null ? b : 0, false, b !== null);
|
||||
return BatteryService.getIcon(b !== null ? b : 0, false, false, b !== null);
|
||||
}
|
||||
pointSize: Style.fontSizeXS
|
||||
color: Color.mOnSurface
|
||||
|
||||
Reference in New Issue
Block a user