diff options
-rw-r--r-- | src/main.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs index a233996..826e0f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,9 +94,9 @@ struct Options { #[structopt(long = "disable-ext-tabline")] disable_ext_tabline: bool, - /// Enables dark theme - #[structopt(long = "prefer-dark-theme")] - prefer_dark_theme: bool, + /// Enables dark theme + #[structopt(long = "prefer-dark-theme")] + prefer_dark_theme: bool, /// Geometry of the window in widthxheight form #[structopt(long = "geometry", parse(try_from_str = parse_geometry), default_value = "1280x720")] @@ -227,13 +227,16 @@ fn main() { glib::set_application_name("GNvim"); gtk::Window::set_default_icon_name("gnvim"); - if opts.prefer_dark_theme { - if let Some(settings) = gtk::Settings::get_default() { - if let Err(err) = settings.set_property("gtk-application-prefer-dark-theme", &true.to_value()) { - error!("Failed to set dark theme setting: {}", err); - } - } - } + if opts.prefer_dark_theme { + if let Some(settings) = gtk::Settings::get_default() { + if let Err(err) = settings.set_property( + "gtk-application-prefer-dark-theme", + &true.to_value(), + ) { + error!("Failed to set dark theme setting: {}", err); + } + } + } app.connect_activate(move |app| { let opts = &opts; |