mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(theming): always sync prefer-light/dark with system theme toggle
Issue: #2357
This commit is contained in:
@@ -178,9 +178,9 @@ async def main():
|
||||
await sync_system_appearance(mode, update_gtk_theme=True)
|
||||
print("GTK colors applied successfully")
|
||||
else:
|
||||
# CSS setup failed; still align gsettings (color-scheme + gtk-theme when themes exist)
|
||||
# so apps do not end up with mismatched prefer-dark vs adw-gtk3 (inverted look).
|
||||
await sync_system_appearance(mode, update_gtk_theme=True)
|
||||
# Still push light/dark preference so portal/GTK apps follow the shell even when
|
||||
# gtk.css / noctalia.css setup failed.
|
||||
await sync_system_appearance(mode, update_gtk_theme=False)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
@@ -18,15 +18,12 @@ Singleton {
|
||||
property string colorsJsonFilePath: Settings.configDir + "colors.json"
|
||||
readonly property string gtkRefreshScript: Quickshell.shellDir + "/Scripts/python/src/theming/gtk-refresh.py"
|
||||
|
||||
// GTK template: post_hook runs gtk-refresh after CSS; skip here to avoid a second, early run.
|
||||
// No GTK template: sync updates org.gnome.desktop.interface when the user enables it.
|
||||
// prefer-light/prefer-dark only; GTK template post_hook still runs full gtk-refresh.
|
||||
function pushSystemColorScheme() {
|
||||
if (!Settings.data.colorSchemes.syncGsettings)
|
||||
return;
|
||||
if (TemplateProcessor.isTemplateEnabled("gtk"))
|
||||
return;
|
||||
const mode = Settings.data.colorSchemes.darkMode ? "dark" : "light";
|
||||
Quickshell.execDetached(["python3", gtkRefreshScript, mode]);
|
||||
Quickshell.execDetached(["python3", gtkRefreshScript, "--appearance-only", mode]);
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
||||
Reference in New Issue
Block a user