mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
fix: Update fully charged battery logic
This commit is contained in:
@@ -43,11 +43,11 @@ Singleton {
|
||||
readonly property real batteryLevel: {
|
||||
if (!batteryAvailable) return 0
|
||||
if (batteryCapacity === 0) {
|
||||
if (usePreferred && device && device.ready) return Math.round(device.percentage)
|
||||
if (usePreferred && device && device.ready) return Math.round(device.percentage * 100)
|
||||
const validBatteries = batteries.filter(b => b.ready && b.percentage >= 0)
|
||||
if (validBatteries.length === 0) return 0
|
||||
const avgPercentage = validBatteries.reduce((sum, b) => sum + b.percentage, 0) / validBatteries.length
|
||||
return Math.round(avgPercentage)
|
||||
return Math.round(avgPercentage * 100)
|
||||
}
|
||||
return Math.round((batteryEnergy * 100) / batteryCapacity)
|
||||
}
|
||||
@@ -134,7 +134,7 @@ Singleton {
|
||||
if (dev && dev.ready && bluetoothTypes.includes(dev.type)) {
|
||||
btDevices.push({
|
||||
"name": dev.model || UPowerDeviceType.toString(dev.type),
|
||||
"percentage": Math.round(dev.percentage),
|
||||
"percentage": Math.round(dev.percentage * 100),
|
||||
"type": dev.type
|
||||
})
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
{
|
||||
"term": "About",
|
||||
"context": "About",
|
||||
"reference": "Modals/Settings/SettingsSidebar.qml:44, Modules/Settings/AboutTab.qml:363",
|
||||
"reference": "Modules/Settings/AboutTab.qml:363, Modals/Settings/SettingsSidebar.qml:44",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -110,13 +110,13 @@
|
||||
{
|
||||
"term": "Add a VPN in NetworkManager",
|
||||
"context": "Add a VPN in NetworkManager",
|
||||
"reference": "Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:147, Modules/DankBar/Popouts/VpnPopout.qml:288",
|
||||
"reference": "Modules/DankBar/Popouts/VpnPopout.qml:288, Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:147",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "All",
|
||||
"context": "All",
|
||||
"reference": "Services/AppSearchService.qml:217, Services/AppSearchService.qml:233, Modals/Spotlight/SpotlightModal.qml:61, Modules/AppDrawer/CategorySelector.qml:11, Modules/AppDrawer/AppLauncher.qml:16, Modules/AppDrawer/AppLauncher.qml:27, Modules/AppDrawer/AppLauncher.qml:28, Modules/AppDrawer/AppLauncher.qml:45, Modules/AppDrawer/AppLauncher.qml:46, Modules/AppDrawer/AppLauncher.qml:80, Modules/AppDrawer/AppDrawerPopout.qml:47",
|
||||
"reference": "Services/AppSearchService.qml:217, Services/AppSearchService.qml:233, Modules/AppDrawer/AppLauncher.qml:16, Modules/AppDrawer/AppLauncher.qml:27, Modules/AppDrawer/AppLauncher.qml:28, Modules/AppDrawer/AppLauncher.qml:45, Modules/AppDrawer/AppLauncher.qml:46, Modules/AppDrawer/AppLauncher.qml:80, Modules/AppDrawer/CategorySelector.qml:11, Modules/AppDrawer/AppDrawerPopout.qml:47, Modals/Spotlight/SpotlightModal.qml:61",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -602,13 +602,13 @@
|
||||
{
|
||||
"term": "Cancel",
|
||||
"context": "Cancel",
|
||||
"reference": "Modals/BluetoothPairingModal.qml:251, Modals/DankColorPickerModal.qml:518, Modals/PolkitAuthModal.qml:291, Modals/WifiPasswordModal.qml:494, Modals/FileBrowser/FileBrowserOverwriteDialog.qml:83, Modules/Settings/PluginBrowser.qml:627",
|
||||
"reference": "Modals/BluetoothPairingModal.qml:251, Modals/DankColorPickerModal.qml:518, Modals/PolkitAuthModal.qml:291, Modals/WifiPasswordModal.qml:494, Modules/Settings/PluginBrowser.qml:627, Modals/FileBrowser/FileBrowserOverwriteDialog.qml:83",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Capacity",
|
||||
"context": "Capacity",
|
||||
"reference": "Modules/ControlCenter/Details/BatteryDetail.qml:171, Modules/DankBar/Popouts/BatteryPopout.qml:352, Modules/DankBar/Popouts/BatteryPopout.qml:508",
|
||||
"reference": "Modules/DankBar/Popouts/BatteryPopout.qml:352, Modules/DankBar/Popouts/BatteryPopout.qml:508, Modules/ControlCenter/Details/BatteryDetail.qml:171",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -698,7 +698,7 @@
|
||||
{
|
||||
"term": "Close",
|
||||
"context": "Close",
|
||||
"reference": "Modules/SystemUpdatePopout.qml:335, Modals/NetworkWiredInfoModal.qml:131, Modals/NetworkInfoModal.qml:131, Modules/DankBar/Widgets/RunningApps.qml:788",
|
||||
"reference": "Modals/NetworkInfoModal.qml:131, Modals/NetworkWiredInfoModal.qml:131, Modules/SystemUpdatePopout.qml:335, Modules/DankBar/Widgets/RunningApps.qml:788",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1148,7 +1148,7 @@
|
||||
{
|
||||
"term": "Disconnect",
|
||||
"context": "Disconnect",
|
||||
"reference": "Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:88, Modules/DankBar/Popouts/VpnPopout.qml:224",
|
||||
"reference": "Modules/DankBar/Popouts/VpnPopout.qml:224, Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:88",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1172,7 +1172,7 @@
|
||||
{
|
||||
"term": "Dismiss",
|
||||
"context": "Dismiss",
|
||||
"reference": "Modules/Notifications/Popup/NotificationPopup.qml:24, Modules/Notifications/Center/NotificationCard.qml:540, Modules/Notifications/Center/NotificationCard.qml:633",
|
||||
"reference": "Modules/Notifications/Center/NotificationCard.qml:540, Modules/Notifications/Center/NotificationCard.qml:633, Modules/Notifications/Popup/NotificationPopup.qml:24",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1718,7 +1718,7 @@
|
||||
{
|
||||
"term": "Health",
|
||||
"context": "Health",
|
||||
"reference": "Modules/ControlCenter/Details/BatteryDetail.qml:136, Modules/DankBar/Popouts/BatteryPopout.qml:317, Modules/DankBar/Popouts/BatteryPopout.qml:471",
|
||||
"reference": "Modules/DankBar/Popouts/BatteryPopout.qml:317, Modules/DankBar/Popouts/BatteryPopout.qml:471, Modules/ControlCenter/Details/BatteryDetail.qml:136",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1946,7 +1946,7 @@
|
||||
{
|
||||
"term": "Launch",
|
||||
"context": "Launch",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:251, Modules/AppDrawer/AppDrawerPopout.qml:746",
|
||||
"reference": "Modules/AppDrawer/AppDrawerPopout.qml:746, Modals/Spotlight/SpotlightContextMenu.qml:251",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1958,7 +1958,7 @@
|
||||
{
|
||||
"term": "Launch on dGPU",
|
||||
"context": "Launch on dGPU",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:312, Modules/AppDrawer/AppDrawerPopout.qml:806, Modules/Dock/DockContextMenu.qml:417",
|
||||
"reference": "Modules/AppDrawer/AppDrawerPopout.qml:806, Modules/Dock/DockContextMenu.qml:417, Modals/Spotlight/SpotlightContextMenu.qml:312",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2036,7 +2036,7 @@
|
||||
{
|
||||
"term": "Log Out",
|
||||
"context": "Log Out",
|
||||
"reference": "Modals/PowerMenuModal.qml:37, Modals/PowerMenuModal.qml:206, Modules/Lock/LockPowerMenu.qml:209, Modules/ControlCenter/PowerMenu.qml:14",
|
||||
"reference": "Modals/PowerMenuModal.qml:37, Modals/PowerMenuModal.qml:206, Modules/ControlCenter/PowerMenu.qml:14, Modules/Lock/LockPowerMenu.qml:209",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2114,7 +2114,7 @@
|
||||
{
|
||||
"term": "Matugen Palette",
|
||||
"context": "Matugen Palette",
|
||||
"reference": "Modules/Settings/ThemeColorsTab.qml:629, Modules/Settings/PersonalizationTab.qml:1785",
|
||||
"reference": "Modules/Settings/PersonalizationTab.qml:1785, Modules/Settings/ThemeColorsTab.qml:629",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2294,7 +2294,7 @@
|
||||
{
|
||||
"term": "Network Information",
|
||||
"context": "Network Information",
|
||||
"reference": "Modals/NetworkWiredInfoModal.qml:61, Modals/NetworkInfoModal.qml:61",
|
||||
"reference": "Modals/NetworkInfoModal.qml:61, Modals/NetworkWiredInfoModal.qml:61",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2372,7 +2372,7 @@
|
||||
{
|
||||
"term": "No VPN profiles found",
|
||||
"context": "No VPN profiles found",
|
||||
"reference": "Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:140, Modules/DankBar/Popouts/VpnPopout.qml:281",
|
||||
"reference": "Modules/DankBar/Popouts/VpnPopout.qml:281, Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml:140",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2684,7 +2684,7 @@
|
||||
{
|
||||
"term": "Pin to Dock",
|
||||
"context": "Pin to Dock",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:110, Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:370",
|
||||
"reference": "Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:370, Modals/Spotlight/SpotlightContextMenu.qml:110, Modals/Spotlight/SpotlightContextMenu.qml:113",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2792,19 +2792,19 @@
|
||||
{
|
||||
"term": "Power Off",
|
||||
"context": "Power Off",
|
||||
"reference": "Modals/PowerMenuModal.qml:53, Modals/PowerMenuModal.qml:421, Modules/Lock/LockPowerMenu.qml:432, Modules/ControlCenter/PowerMenu.qml:17",
|
||||
"reference": "Modals/PowerMenuModal.qml:53, Modals/PowerMenuModal.qml:421, Modules/ControlCenter/PowerMenu.qml:17, Modules/Lock/LockPowerMenu.qml:432",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Power Options",
|
||||
"context": "Power Options",
|
||||
"reference": "Modals/PowerMenuModal.qml:149, Modules/Lock/LockPowerMenu.qml:154, Modules/ControlCenter/PowerMenu.qml:13",
|
||||
"reference": "Modals/PowerMenuModal.qml:149, Modules/ControlCenter/PowerMenu.qml:13, Modules/Lock/LockPowerMenu.qml:154",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Power Profile Degradation",
|
||||
"context": "Power Profile Degradation",
|
||||
"reference": "Modules/ControlCenter/Details/BatteryDetail.qml:240, Modules/DankBar/Popouts/BatteryPopout.qml:625",
|
||||
"reference": "Modules/DankBar/Popouts/BatteryPopout.qml:625, Modules/ControlCenter/Details/BatteryDetail.qml:240",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2912,7 +2912,7 @@
|
||||
{
|
||||
"term": "Reboot",
|
||||
"context": "Reboot",
|
||||
"reference": "Modals/PowerMenuModal.qml:49, Modals/PowerMenuModal.qml:367, Modules/Lock/LockPowerMenu.qml:372, Modules/ControlCenter/PowerMenu.qml:16",
|
||||
"reference": "Modals/PowerMenuModal.qml:49, Modals/PowerMenuModal.qml:367, Modules/ControlCenter/PowerMenu.qml:16, Modules/Lock/LockPowerMenu.qml:372",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3014,7 +3014,7 @@
|
||||
{
|
||||
"term": "Save",
|
||||
"context": "Save",
|
||||
"reference": "Modals/FileBrowser/FileBrowserSaveRow.qml:55, Modules/Notepad/NotepadTextEditor.qml:511, Modules/Notepad/Notepad.qml:480",
|
||||
"reference": "Modules/Notepad/Notepad.qml:480, Modules/Notepad/NotepadTextEditor.qml:511, Modals/FileBrowser/FileBrowserSaveRow.qml:55",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3152,7 +3152,7 @@
|
||||
{
|
||||
"term": "Select the palette algorithm used for wallpaper-based colors",
|
||||
"context": "Select the palette algorithm used for wallpaper-based colors",
|
||||
"reference": "Modules/Settings/ThemeColorsTab.qml:630, Modules/Settings/PersonalizationTab.qml:1786",
|
||||
"reference": "Modules/Settings/PersonalizationTab.qml:1786, Modules/Settings/ThemeColorsTab.qml:630",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3188,7 +3188,7 @@
|
||||
{
|
||||
"term": "Settings",
|
||||
"context": "Settings",
|
||||
"reference": "Services/AppSearchService.qml:176, Modals/Settings/SettingsModal.qml:168, Modules/DankDash/DankDashPopout.qml:249",
|
||||
"reference": "Services/AppSearchService.qml:176, Modules/DankDash/DankDashPopout.qml:249, Modals/Settings/SettingsModal.qml:168",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3440,7 +3440,7 @@
|
||||
{
|
||||
"term": "Suspend",
|
||||
"context": "Suspend",
|
||||
"reference": "Modals/PowerMenuModal.qml:41, Modals/PowerMenuModal.qml:259, Modules/Lock/LockPowerMenu.qml:260, Modules/ControlCenter/PowerMenu.qml:15",
|
||||
"reference": "Modals/PowerMenuModal.qml:41, Modals/PowerMenuModal.qml:259, Modules/ControlCenter/PowerMenu.qml:15, Modules/Lock/LockPowerMenu.qml:260",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3734,7 +3734,7 @@
|
||||
{
|
||||
"term": "Unpin from Dock",
|
||||
"context": "Unpin from Dock",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:370",
|
||||
"reference": "Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:370, Modals/Spotlight/SpotlightContextMenu.qml:113",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user