Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dark mode switch #836

Merged
merged 5 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cozy/application_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions cozy/ui/preferences_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class PreferencesWindow(Adw.PreferencesDialog):
storages_page: Adw.PreferencesPage = Gtk.Template.Child()
user_feedback_preference_group: Adw.PreferencesGroup = Gtk.Template.Child()

dark_mode_switch: Adw.SwitchRow = Gtk.Template.Child()
swap_author_reader_switch: Adw.SwitchRow = Gtk.Template.Child()
replay_switch: Adw.SwitchRow = Gtk.Template.Child()
sleep_timer_fadeout_switch: Adw.SwitchRow = Gtk.Template.Child()
Expand Down Expand Up @@ -44,7 +43,6 @@ def _bind_settings(self) -> None:
setting, widget, propetry, Gio.SettingsBindFlags.DEFAULT
)

bind_settings("dark-mode", self.dark_mode_switch, "active")
bind_settings("swap-author-reader", self.swap_author_reader_switch, "active")
bind_settings("replay", self.replay_switch, "active")
bind_settings("rewind-duration", self.rewind_duration_adjustment, "value")
Expand Down
17 changes: 0 additions & 17 deletions cozy/view_model/settings_view_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import logging

from gi.repository import Adw

from cozy.application_settings import ApplicationSettings
from cozy.architecture.event_sender import EventSender
from cozy.architecture.observable import Observable
Expand All @@ -23,11 +21,6 @@ def __init__(self):

self._lock_ui: bool = False

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()

Expand All @@ -39,13 +32,3 @@ def lock_ui(self) -> bool:
def lock_ui(self, new_value: bool):
self._lock_ui = new_value
self._notify("lock_ui")

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()
7 changes: 1 addition & 6 deletions data/com.github.geigi.cozy.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
<summary>Display the time according to the playback speed.</summary>
<description></description>
</key>
<key type="b" name="dark-mode">
<default>false</default>
<summary>Enable Dark Mode.</summary>
<description></description>
</key>
<key type="b" name="swap-author-reader">
<default>false</default>
<summary>Swap author and reader tag assignment.</summary>
Expand Down Expand Up @@ -112,4 +107,4 @@
<description></description>
</key>
</schema>
</schemalist>
</schemalist>
8 changes: 0 additions & 8 deletions data/ui/preferences.blp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ template $PreferencesWindow: Adw.PreferencesDialog {
icon-name: 'settings-symbolic';
title: _("General");

Adw.PreferencesGroup {
title: _("Appearance");

Adw.SwitchRow dark_mode_switch {
title: _("Dark Mode");
}
}

Adw.PreferencesGroup {
title: _("Tags");

Expand Down