Remove dark mode setting

It does not make sense to keep supporting this.
This commit is contained in:
Maximiliano Sandoval R 2023-04-10 00:26:56 +02:00
parent b31c342fba
commit e887e0a56c
No known key found for this signature in database
GPG Key ID: D64A8D747F6FE706
4 changed files with 0 additions and 50 deletions

View File

@ -16,11 +16,6 @@
<summary>Default window maximized behaviour</summary>
<description></description>
</key>
<key name="dark-theme" type="b">
<default>false</default>
<summary>Dark Mode</summary>
<description>Whether the application should use a dark mode.</description>
</key>
<key name="auto-lock" type="b">
<default>false</default>
<summary>Auto lock</summary>

View File

@ -14,24 +14,6 @@
<object class="AdwPreferencesPage">
<property name="icon-name">applications-system-symbolic</property>
<property name="title" translatable="yes">General</property>
<child>
<object class="AdwPreferencesGroup" id="dark_mode_group">
<property name="title" translatable="yes">Appearance</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">_Dark Mode</property>
<property name="use-underline">True</property>
<property name="activatable-widget">dark_mode_switch</property>
<property name="subtitle" translatable="yes">Whether the application should use a dark mode</property>
<child>
<object class="GtkSwitch" id="dark_mode_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Privacy</property>

View File

@ -174,12 +174,10 @@ mod imp {
}
},
"auto-lock-timeout" => app.restart_lock_timeout(),
"dark-theme" => app.update_color_scheme(),
_ => ()
}
}),
);
app.update_color_scheme();
let ctx = glib::MainContext::default();
ctx.spawn_local(clone!(@strong app => async move {
@ -344,18 +342,6 @@ impl Application {
}
}
fn update_color_scheme(&self) {
let manager = self.style_manager();
if !manager.system_supports_color_schemes() {
let color_scheme = if SETTINGS.boolean("dark-theme") {
adw::ColorScheme::PreferDark
} else {
adw::ColorScheme::PreferLight
};
manager.set_color_scheme(color_scheme);
}
}
fn account_provider_by_identifier(&self, id: &str) -> Option<(Provider, Account)> {
let identifier = id.split(':').collect::<Vec<&str>>();
let provider_id = identifier.first()?.parse::<u32>().ok()?;

View File

@ -47,14 +47,10 @@ mod imp {
pub restore_group: TemplateChild<adw::PreferencesGroup>,
#[template_child(id = "auto_lock_switch")]
pub auto_lock: TemplateChild<gtk::Switch>,
#[template_child(id = "dark_mode_switch")]
pub dark_mode: TemplateChild<gtk::Switch>,
#[template_child(id = "download_favicons_switch")]
pub download_favicons: TemplateChild<gtk::Switch>,
#[template_child(id = "download_favicons_metered_switch")]
pub download_favicons_metered: TemplateChild<gtk::Switch>,
#[template_child]
pub dark_mode_group: TemplateChild<adw::PreferencesGroup>,
#[template_child(id = "lock_timeout_spin_btn")]
pub lock_timeout: TemplateChild<gtk::SpinButton>,
pub key_entries: RefCell<HashMap<String, gtk::PasswordEntry>>,
@ -78,13 +74,11 @@ mod imp {
backup_actions: gio::SimpleActionGroup::new(),
restore_actions: gio::SimpleActionGroup::new(),
auto_lock: TemplateChild::default(),
dark_mode: TemplateChild::default(),
download_favicons: TemplateChild::default(),
download_favicons_metered: TemplateChild::default(),
lock_timeout: TemplateChild::default(),
backup_group: TemplateChild::default(),
restore_group: TemplateChild::default(),
dark_mode_group: TemplateChild::default(),
key_entries: RefCell::default(),
}
}
@ -158,13 +152,6 @@ impl PreferencesWindow {
fn setup_widget(&self) {
let imp = self.imp();
let style_manager = adw::StyleManager::default();
imp.dark_mode_group
.set_visible(!style_manager.system_supports_color_schemes());
SETTINGS
.bind("dark-theme", &*imp.dark_mode, "active")
.build();
SETTINGS
.bind("download-favicons", &*imp.download_favicons, "active")
.build();