diff --git a/Modules/LockScreen/LockScreen.qml b/Modules/LockScreen/LockScreen.qml index 2cb2c858b..dd046f8c1 100644 --- a/Modules/LockScreen/LockScreen.qml +++ b/Modules/LockScreen/LockScreen.qml @@ -82,7 +82,7 @@ Loader { property real percent: BatteryService.batteryPercentage property bool charging: BatteryService.batteryCharging property bool pluggedIn: BatteryService.batteryPluggedIn - property bool batteryVisible: isReady && BatteryService.hasAnyBattery() + property bool batteryVisible: isReady } Item { diff --git a/Modules/LockScreen/LockScreenPanel.qml b/Modules/LockScreen/LockScreenPanel.qml index 0f7d2c6b6..28d838056 100644 --- a/Modules/LockScreen/LockScreenPanel.qml +++ b/Modules/LockScreen/LockScreenPanel.qml @@ -109,7 +109,7 @@ Item { // Compact status indicators container (compact mode only) Rectangle { width: { - var hasBattery = batteryIndicator.isReady && BatteryService.hasAnyBattery(); + var hasBattery = batteryIndicator.isReady; var hasKeyboard = keyboardLayout.currentLayout !== "Unknown"; if (hasBattery && hasKeyboard) { @@ -127,7 +127,7 @@ Item { topLeftRadius: Style.radiusL topRightRadius: Style.radiusL color: Color.mSurface - visible: Settings.data.general.compactLockScreen && ((batteryIndicator.isReady && BatteryService.hasAnyBattery()) || keyboardLayout.currentLayout !== "Unknown") + visible: Settings.data.general.compactLockScreen && ((batteryIndicator.isReady) || keyboardLayout.currentLayout !== "Unknown") RowLayout { anchors.centerIn: parent @@ -136,7 +136,7 @@ Item { // Battery indicator RowLayout { spacing: Style.marginS - visible: batteryIndicator.isReady && BatteryService.hasAnyBattery() + visible: batteryIndicator.isReady NIcon { icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.pluggedIn, batteryIndicator.isReady) @@ -449,19 +449,19 @@ Item { } Item { - Layout.fillWidth: batteryIndicator.isReady && BatteryService.hasAnyBattery() + Layout.fillWidth: batteryIndicator.isReady } // Battery and Keyboard Layout (full mode only) ColumnLayout { - Layout.alignment: (batteryIndicator.isReady && BatteryService.hasAnyBattery()) ? (Qt.AlignRight | Qt.AlignVCenter) : Qt.AlignVCenter + Layout.alignment: (batteryIndicator.isReady) ? (Qt.AlignRight | Qt.AlignVCenter) : Qt.AlignVCenter spacing: Style.marginM - visible: (batteryIndicator.isReady && BatteryService.hasAnyBattery()) || keyboardLayout.currentLayout !== "Unknown" + visible: (batteryIndicator.isReady) || keyboardLayout.currentLayout !== "Unknown" // Battery RowLayout { spacing: Style.marginXS - visible: batteryIndicator.isReady && BatteryService.hasAnyBattery() + visible: batteryIndicator.isReady NIcon { icon: BatteryService.getIcon(Math.round(batteryIndicator.percent), batteryIndicator.charging, batteryIndicator.pluggedIn, batteryIndicator.isReady) diff --git a/Services/Hardware/BatteryService.qml b/Services/Hardware/BatteryService.qml index da53dcd1e..b8aebf27f 100644 --- a/Services/Hardware/BatteryService.qml +++ b/Services/Hardware/BatteryService.qml @@ -202,10 +202,6 @@ Singleton { return "battery-off"; // New fallback icon clearly represent if nothing is true here. } - function hasAnyBattery() { - return primaryDevice !== null; - } - function getRateText(device) { if (!device || device.changeRate === undefined) { return "";