From 1dd51d570c2a607c105bcb385d5e53cbe5e6742c Mon Sep 17 00:00:00 2001 From: rdbende Date: Fri, 22 Dec 2023 21:35:07 +0100 Subject: [PATCH] Remove dark mode preference With the GTK4 + libadwaita port Cozy now automatically follows the system color scheme, and this setting is no longer needed. --- cozy/application_settings.py | 8 -------- cozy/ui/preferences_view.py | 4 ---- cozy/view_model/settings_view_model.py | 16 ---------------- data/com.github.geigi.cozy.gschema.xml | 7 +------ data/ui/preferences.ui | 10 ---------- 5 files changed, 1 insertion(+), 44 deletions(-) diff --git a/cozy/application_settings.py b/cozy/application_settings.py index 8a4cbe62..fa59a654 100644 --- a/cozy/application_settings.py +++ b/cozy/application_settings.py @@ -109,14 +109,6 @@ def forward_duration(self) -> int: def forward_duration(self, new_value): self._settings.set_int("forward-duration", new_value) - @property - def dark_mode(self) -> bool: - return self._settings.get_boolean("dark-mode") - - @dark_mode.setter - def dark_mode(self, new_value: bool): - self._settings.set_boolean("dark-mode", new_value) - @property def window_width(self) -> int: return self._settings.get_int("window-width") diff --git a/cozy/ui/preferences_view.py b/cozy/ui/preferences_view.py index 709488a1..02175114 100644 --- a/cozy/ui/preferences_view.py +++ b/cozy/ui/preferences_view.py @@ -17,7 +17,6 @@ class PreferencesView(Adw.PreferencesWindow): _glib_settings: Gio.Settings = inject.attr(Gio.Settings) _view_model: SettingsViewModel = inject.attr(SettingsViewModel) - dark_mode_switch: Gtk.Switch = Gtk.Template.Child() swap_author_reader_switch: Gtk.Switch = Gtk.Template.Child() replay_switch: Gtk.Switch = Gtk.Template.Child() sleep_timer_fadeout_switch: Adw.SwitchRow = Gtk.Template.Child() @@ -67,9 +66,6 @@ def _bind_view_model(self): self._view_model.bind_to("storage_attributes", self._refresh_storage_rows) def _bind_settings(self): - self._glib_settings.bind("dark-mode", self.dark_mode_switch, "active", - Gio.SettingsBindFlags.DEFAULT) - self._glib_settings.bind("swap-author-reader", self.swap_author_reader_switch, "active", Gio.SettingsBindFlags.DEFAULT) diff --git a/cozy/view_model/settings_view_model.py b/cozy/view_model/settings_view_model.py index 28251f8a..30e0fedf 100644 --- a/cozy/view_model/settings_view_model.py +++ b/cozy/view_model/settings_view_model.py @@ -33,12 +33,6 @@ def __init__(self): self._lock_ui: bool = False - self._gtk_settings = Gtk.Settings.get_default() - self.style_manager = Adw.StyleManager.get_default() - self._set_dark_mode() - - self._app_settings.add_listener(self._on_app_setting_changed) - if self._model.first_start: self._importer.scan() @@ -119,13 +113,3 @@ def add_first_storage_location(self, path: str): self._model.invalidate() self._notify("storage_locations") - - def _set_dark_mode(self): - if self._app_settings.dark_mode: - self.style_manager.set_color_scheme(Adw.ColorScheme.PREFER_DARK) - else: - self.style_manager.set_color_scheme(Adw.ColorScheme.PREFER_LIGHT) - - def _on_app_setting_changed(self, event: str, data): - if event == "dark-mode": - self._set_dark_mode() diff --git a/data/com.github.geigi.cozy.gschema.xml b/data/com.github.geigi.cozy.gschema.xml index ecb44add..b8ddeec9 100644 --- a/data/com.github.geigi.cozy.gschema.xml +++ b/data/com.github.geigi.cozy.gschema.xml @@ -41,11 +41,6 @@ Display the time according to the playback speed. - - false - Enable Dark Mode. - - false Swap author and reader tag assignment. @@ -112,4 +107,4 @@ - \ No newline at end of file + diff --git a/data/ui/preferences.ui b/data/ui/preferences.ui index 20045d83..86de8ba1 100644 --- a/data/ui/preferences.ui +++ b/data/ui/preferences.ui @@ -25,16 +25,6 @@ settings-symbolic General - - - Appearance - - - Dark Mode - - - - Tags