settings: when changed externally refresh bar widgets, fix #1925

This commit is contained in:
Lemmy
2026-02-24 19:31:05 -05:00
parent 07be43462f
commit ce4be173a9
2 changed files with 14 additions and 1 deletions
+4 -1
View File
@@ -36,9 +36,9 @@ Singleton {
readonly property string defaultVideosDirectory: Quickshell.env("HOME") + "/Videos"
readonly property string defaultWallpapersDirectory: Quickshell.env("HOME") + "/Pictures/Wallpapers"
// Signal emitted when settings are loaded after startupcale changes
signal settingsLoaded
signal settingsSaved
signal settingsReloaded
// -----------------------------------------------------
// -----------------------------------------------------
@@ -121,6 +121,9 @@ Singleton {
root.settingsLoaded();
upgradeSettings();
} else {
Logger.d("Settings", "Settings reloaded from external file change");
root.settingsReloaded();
}
}
onLoadFailed: function (error) {
+10
View File
@@ -143,6 +143,16 @@ Singleton {
Logger.i("BarService", "Service started");
}
// Bump widgetsRevision when settings are reloaded from an external file change
// so Bar.qml re-syncs its widget ListModels with the updated widget configuration
Connections {
target: Settings
function onSettingsReloaded() {
Logger.d("BarService", "Settings reloaded externally, bumping widgetsRevision");
root.widgetsRevision++;
}
}
// update bar's hidden state when mode changes
Connections {
target: Settings.data.bar