mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 22:18:30 -04:00
refactor(battery): align status layout and add individual notification types (#2743)
* refactor(battery): restore status list layout and add individual notification types * settings/battery: fix RTL display of top tablular-like view --------- Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ Singleton {
|
||||
id: root
|
||||
readonly property var log: Log.scoped("SettingsData")
|
||||
|
||||
readonly property int settingsConfigVersion: 11
|
||||
readonly property int settingsConfigVersion: 12
|
||||
|
||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||
|
||||
@@ -752,7 +752,9 @@ Singleton {
|
||||
property bool batteryNotifyCritical: true
|
||||
property int batteryLowThreshold: 20
|
||||
property bool batteryNotifyLow: false
|
||||
property int batteryNotificationType: 0
|
||||
property int batteryChargeLimitNotificationType: 0
|
||||
property int batteryLowNotificationType: 0
|
||||
property int batteryCriticalNotificationType: 1
|
||||
property bool batteryAutoPowerSaver: false
|
||||
property bool showBatteryPercent: true
|
||||
property bool showBatteryPercentOnlyOnBattery: false
|
||||
|
||||
@@ -339,7 +339,9 @@ var SPEC = {
|
||||
batteryNotifyCritical: { def: true },
|
||||
batteryLowThreshold: { def: 20 },
|
||||
batteryNotifyLow: { def: false },
|
||||
batteryNotificationType: { def: 0 },
|
||||
batteryChargeLimitNotificationType: { def: 0 },
|
||||
batteryLowNotificationType: { def: 0 },
|
||||
batteryCriticalNotificationType: { def: 1 },
|
||||
batteryAutoPowerSaver: { def: false },
|
||||
lockBeforeSuspend: { def: false },
|
||||
loginctlLockIntegration: { def: true },
|
||||
|
||||
@@ -252,6 +252,17 @@ function migrateToVersion(obj, targetVersion) {
|
||||
settings.configVersion = 11;
|
||||
}
|
||||
|
||||
if (currentVersion < 12) {
|
||||
console.info("Migrating settings from version", currentVersion, "to version 12");
|
||||
if (settings.batteryNotificationType !== undefined) {
|
||||
settings.batteryChargeLimitNotificationType = settings.batteryNotificationType;
|
||||
settings.batteryLowNotificationType = settings.batteryNotificationType;
|
||||
settings.batteryCriticalNotificationType = settings.batteryNotificationType;
|
||||
delete settings.batteryNotificationType;
|
||||
}
|
||||
settings.configVersion = 12;
|
||||
}
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user