Bar Widget Settings: One file per Widget settings, refactor - wip

This commit is contained in:
LemmyCook 2025-09-07 21:45:28 -04:00
parent c01167c9da
commit 45af873a6f
27 changed files with 707 additions and 765 deletions

View file

@ -27,8 +27,7 @@ Item {
return {}
}
readonly property bool userAlwaysShowPercentage: (widgetSettings.alwaysShowPercentage
!== undefined) ? widgetSettings.alwaysShowPercentage : BarWidgetRegistry.widgetMetadata["Microphone"].alwaysShowPercentage
readonly property bool userAlwaysShowPercentage: widgetSettings?.alwaysShowPercentage
// Used to avoid opening the pill on Quickshell startup
property bool firstInputVolumeReceived: false
@ -83,23 +82,6 @@ Item {
}
}
Component.onCompleted: {
try {
var section = barSection.replace("Section", "").toLowerCase()
if (section && sectionWidgetIndex >= 0) {
var widgets = Settings.data.bar.widgets[section]
if (widgets && sectionWidgetIndex < widgets.length) {
if (widgets[sectionWidgetIndex].alwaysShowPercentage === undefined
&& Settings.data.bar.alwaysShowBatteryPercentage !== undefined) {
widgets[sectionWidgetIndex].alwaysShowPercentage = Settings.data.bar.alwaysShowBatteryPercentage
}
}
}
} catch (e) {
}
}
NPill {
id: pill