From 01218f34cbc2c96218c5b51d4b0086e44e6b130b Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 24 Feb 2026 19:42:04 -0500 Subject: [PATCH] settings: restore notifyHorizontalBarChanged --- quickshell/Modules/Settings/DankBarTab.qml | 34 ++++++++++++++++++++++ quickshell/Services/BarWidgetService.qml | 4 +++ 2 files changed, 38 insertions(+) diff --git a/quickshell/Modules/Settings/DankBarTab.qml b/quickshell/Modules/Settings/DankBarTab.qml index 7457fe24..540b9b22 100644 --- a/quickshell/Modules/Settings/DankBarTab.qml +++ b/quickshell/Modules/Settings/DankBarTab.qml @@ -28,6 +28,35 @@ Item { return pos === SettingsData.Position.Left || pos === SettingsData.Position.Right; } + Timer { + id: horizontalBarChangeDebounce + interval: 500 + repeat: false + onTriggered: { + const verticalBars = SettingsData.barConfigs.filter(cfg => { + const pos = cfg.position ?? SettingsData.Position.Top; + return pos === SettingsData.Position.Left || pos === SettingsData.Position.Right; + }); + + verticalBars.forEach(bar => { + if (!bar.enabled) + return; + SettingsData.updateBarConfig(bar.id, { + enabled: false + }); + Qt.callLater(() => SettingsData.updateBarConfig(bar.id, { + enabled: true + })); + }); + } + } + + function notifyHorizontalBarChange() { + if (selectedBarIsVertical) + return; + horizontalBarChangeDebounce.restart(); + } + function createNewBar() { if (SettingsData.barConfigs.length >= 4) return; @@ -514,6 +543,9 @@ Item { SettingsData.updateBarConfig(selectedBarId, { position: newPos }); + const isVertical = newPos === SettingsData.Position.Left || newPos === SettingsData.Position.Right; + if (wasVertical !== isVertical || !isVertical) + notifyHorizontalBarChange(); } } } @@ -532,6 +564,7 @@ Item { SettingsData.updateBarConfig(selectedBarId, { autoHide: toggled }); + notifyHorizontalBarChange(); } } @@ -598,6 +631,7 @@ Item { SettingsData.updateBarConfig(selectedBarId, { visible: toggled }); + notifyHorizontalBarChange(); } } diff --git a/quickshell/Services/BarWidgetService.qml b/quickshell/Services/BarWidgetService.qml index 205a8fd8..0ae2450a 100644 --- a/quickshell/Services/BarWidgetService.qml +++ b/quickshell/Services/BarWidgetService.qml @@ -18,6 +18,8 @@ Singleton { function registerWidget(widgetId, screenName, widgetRef) { if (!widgetId || !screenName || !widgetRef) return; + if (typeof widgetRegistry !== "object" || widgetRegistry === null) + widgetRegistry = ({}); if (!widgetRegistry[widgetId]) widgetRegistry[widgetId] = {}; @@ -29,6 +31,8 @@ Singleton { function unregisterWidget(widgetId, screenName) { if (!widgetId || !screenName) return; + if (typeof widgetRegistry !== "object" || widgetRegistry === null) + return; if (!widgetRegistry[widgetId]) return;