From 233eb6bc532eaa10d823821658525011726419c6 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sat, 8 Aug 2020 14:43:26 +0300 Subject: [PATCH] added dark mode option --- app/settings.py | 8 ++++++++ app/ui/settings_dialog.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/app/settings.py b/app/settings.py index d3a53300..81148df2 100644 --- a/app/settings.py +++ b/app/settings.py @@ -612,6 +612,14 @@ class Settings: # *********** Appearance *********** # + @property + def dark_mode(self): + return self._settings.get("dark_mode", False) + + @dark_mode.setter + def dark_mode(self, value): + self._settings["dark_mode"] = value + @property def is_themes_support(self): return self._settings.get("is_themes_support", False) diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index 12a89925..5b442ff0 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -192,6 +192,7 @@ class SettingsDialog: self._theme_thumbnail_image = builder.get_object("theme_thumbnail_image") self._theme_combo_box = builder.get_object("theme_combo_box") self._icon_theme_combo_box = builder.get_object("icon_theme_combo_box") + self._dark_mode_switch = builder.get_object("dark_mode_switch") self._themes_support_switch = builder.get_object("themes_support_switch") self._themes_support_switch.bind_property("active", builder.get_object("gtk_theme_frame"), "sensitive") self._themes_support_switch.bind_property("active", builder.get_object("icon_theme_frame"), "sensitive") @@ -356,6 +357,7 @@ class SettingsDialog: self._ext_settings.active_preset = self._presets_combo_box.get_active_id() if self._ext_settings.is_darwin: + self._ext_settings.dark_mode = self._dark_mode_switch.get_active() self._ext_settings.is_themes_support = self._themes_support_switch.get_active() self._ext_settings.theme = self._theme_combo_box.get_active_id() self._ext_settings.icon_theme = self._icon_theme_combo_box.get_active_id() @@ -772,6 +774,7 @@ class SettingsDialog: @run_idle def init_appearance(self): + self._dark_mode_switch.set_active(self._ext_settings.dark_mode) t_support = self._ext_settings.is_themes_support self._themes_support_switch.set_active(t_support) if t_support: