1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

feat: Implement battery widget in Control Center

This commit is contained in:
purian23
2025-09-14 16:40:09 -04:00
parent ba6c7ae28c
commit 76ee483b27

View File

@@ -11,6 +11,7 @@ import qs.Modules.ControlCenter
import qs.Modules.ControlCenter.Widgets
import qs.Modules.ControlCenter.Details
import qs.Modules.ControlCenter.Details 1.0 as Details
import qs.Modules.TopBar
import qs.Services
import qs.Widgets
@@ -239,6 +240,24 @@ DankPopout {
anchors.rightMargin: Theme.spacingL
spacing: Theme.spacingS
Battery {
widgetHeight: 40
popupTarget: controlCenterBatteryPopout
parentScreen: root.triggerScreen
section: "right"
barHeight: 123
batteryPopupVisible: controlCenterBatteryPopout.shouldBeVisible
visible: BatteryService.batteryAvailable
onToggleBatteryPopup: {
if (controlCenterBatteryPopout.shouldBeVisible) {
controlCenterBatteryPopout.close()
} else {
controlCenterBatteryPopout.open()
}
}
}
DankActionButton {
buttonSize: 40
iconName: "lock"
@@ -718,6 +737,10 @@ DankPopout {
}
}
BatteryPopout {
id: controlCenterBatteryPopout
}
Component {
id: networkDetailComponent
NetworkDetail {}