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

osd: try to optimize power profile osd more

This commit is contained in:
bbedward
2025-11-23 17:29:56 -05:00
parent 5ce1cb87ea
commit 2ae911230d
3 changed files with 127 additions and 84 deletions

View File

@@ -12,22 +12,19 @@ DankOSD {
autoHideInterval: 2000
enableMouseInteraction: false
property int lastProfile: -1
Connections {
target: typeof PowerProfiles !== "undefined" ? PowerProfiles : null
target: BatteryService
function onProfileChanged() {
if (lastProfile !== -1 && lastProfile !== PowerProfiles.profile && SettingsData.osdPowerProfileEnabled) {
function onPowerProfileChanged() {
if (SettingsData.osdPowerProfileEnabled) {
root.show()
}
lastProfile = PowerProfiles.profile
}
}
Component.onCompleted: {
if (typeof PowerProfiles !== "undefined") {
lastProfile = PowerProfiles.profile
if (SettingsData.osdPowerProfileEnabled) {
root.show()
}
}