BatterySettings: add option to pick which battery is being shown

BatteryPanel: remove redundant things
This commit is contained in:
Ly-sec
2025-11-28 20:55:50 +01:00
parent 46f881026e
commit aeee91d08a
16 changed files with 423 additions and 202 deletions
@@ -153,9 +153,15 @@ Popup {
function loadWidgetSettings() {
const source = BarWidgetRegistry.widgetSettingsMap[widgetId];
if (source) {
// Use setSource to pass properties at creation time
var currentWidgetData = widgetData;
if (sectionId && widgetIndex >= 0) {
var widgets = Settings.data.bar.widgets[sectionId];
if (widgets && widgetIndex < widgets.length) {
currentWidgetData = widgets[widgetIndex];
}
}
settingsLoader.setSource(source, {
"widgetData": widgetData,
"widgetData": currentWidgetData,
"widgetMetadata": BarWidgetRegistry.widgetMetadata[widgetId]
});
}