diff --git a/src/Plug.vala b/src/Plug.vala index d68b41c00..b5a24c7eb 100644 --- a/src/Plug.vala +++ b/src/Plug.vala @@ -133,6 +133,7 @@ public class PantheonShell.Plug : Switchboard.Plug { search_results.set ("%s → %s → %s".printf (display_name, _("Dock & Panel"), _("Panel translucency")), "dock"); search_results.set ("%s → %s".printf (display_name, _("Appearance")), "appearance"); search_results.set ("%s → %s → %s".printf (display_name, _("Appearance"), _("Dark style")), "appearance"); + search_results.set ("%s → %s → %s".printf (display_name, _("Appearance"), _("Dim Wallpaper With Dark Style")), "appearance"); search_results.set ("%s → %s → %s".printf (display_name, _("Appearance"), _("Accent Color")), "appearance"); search_results.set ("%s → %s → %s".printf (display_name, _("Appearance"), _("Always Show Scrollbars")), "appearance"); search_results.set ("%s → %s → %s".printf (display_name, _("Appearance"), _("Reduce Motion")), "appearance"); diff --git a/src/Views/Appearance.vala b/src/Views/Appearance.vala index 097eb49b6..a7c71e6f8 100644 --- a/src/Views/Appearance.vala +++ b/src/Views/Appearance.vala @@ -99,6 +99,21 @@ public class PantheonShell.Appearance : Gtk.Box { prefer_style_box.append (prefer_default_radio); prefer_style_box.append (prefer_dark_radio); + var dim_switch = new Gtk.Switch () { + valign = CENTER + }; + + var dim_label = new Granite.HeaderLabel (_("Dim Wallpaper With Dark Style")) { + hexpand = true, + mnemonic_widget = dim_switch + }; + + var dim_box = new Gtk.Box (HORIZONTAL, 12) { + margin_top = 18 + }; + dim_box.append (dim_label); + dim_box.append (dim_switch); + var schedule_label = new Granite.HeaderLabel (_("Schedule")); var schedule_disabled_radio = new Gtk.CheckButton.with_label (_("Disabled")) { @@ -172,11 +187,12 @@ public class PantheonShell.Appearance : Gtk.Box { if (((GLib.DBusProxy) pantheon_act).get_cached_property ("PrefersColorScheme") != null) { grid.attach (dark_label, 0, 0, 2); grid.attach (prefer_style_box, 0, 2, 2); - grid.attach (schedule_label, 0, 3, 2); - grid.attach (schedule_disabled_radio, 0, 4, 2); - grid.attach (schedule_sunset_radio, 0, 5, 2); - grid.attach (schedule_manual_radio, 0, 6); - grid.attach (schedule_manual_box, 1, 6); + grid.attach (dim_box, 0, 3, 2); + grid.attach (schedule_label, 0, 4, 2); + grid.attach (schedule_disabled_radio, 0, 5, 2); + grid.attach (schedule_sunset_radio, 0, 6, 2); + grid.attach (schedule_manual_radio, 0, 7); + grid.attach (schedule_manual_box, 1, 7); switch (pantheon_act.prefers_color_scheme) { case Granite.Settings.ColorScheme.DARK: @@ -349,8 +365,8 @@ public class PantheonShell.Appearance : Gtk.Box { accent_box.append (slate_button); accent_box.append (auto_button); - grid.attach (accent_label, 0, 7, 2); - grid.attach (accent_box, 0, 8, 2); + grid.attach (accent_label, 0, 8, 2); + grid.attach (accent_box, 0, 9, 2); } var animations_switch = new Gtk.Switch () { @@ -399,6 +415,9 @@ public class PantheonShell.Appearance : Gtk.Box { animations_settings.bind ("enable-animations", animations_switch, "active", SettingsBindFlags.INVERT_BOOLEAN); interface_settings.bind ("overlay-scrolling", scrollbar_switch, "active", INVERT_BOOLEAN); + + var background_settings = new GLib.Settings ("io.elementary.desktop.background"); + background_settings.bind ("dim-wallpaper-in-dark-style", dim_switch, "active", DEFAULT); } private class PrefersAccentColorButton : Gtk.CheckButton { diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index 335e008ef..517684601 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -23,12 +23,10 @@ public class PantheonShell.Wallpaper : Gtk.Box { public Switchboard.Plug plug { get; construct set; } private static GLib.Settings gnome_background_settings; - private static GLib.Settings gala_background_settings; private Gtk.ScrolledWindow wallpaper_scrolled_window; private Gtk.FlowBox wallpaper_view; private Gtk.Overlay view_overlay; - private Gtk.Switch dim_switch; private Gtk.ComboBoxText combo; private Gtk.ColorButton color_button; @@ -48,7 +46,6 @@ public class PantheonShell.Wallpaper : Gtk.Box { static construct { gnome_background_settings = new GLib.Settings ("org.gnome.desktop.background"); - gala_background_settings = new GLib.Settings ("io.elementary.desktop.background"); } construct { @@ -89,13 +86,6 @@ public class PantheonShell.Wallpaper : Gtk.Box { margin_start = 12 }; - var dim_label = new Gtk.Label (_("Dim with dark style:")); - - dim_switch = new Gtk.Switch () { - margin_end = 6, - valign = CENTER - }; - combo = new Gtk.ComboBoxText () { margin_end = 6, valign = CENTER @@ -131,8 +121,6 @@ public class PantheonShell.Wallpaper : Gtk.Box { actionbar.pack_start (add_wallpaper_button); actionbar.pack_end (color_button); actionbar.pack_end (combo); - actionbar.pack_end (dim_switch); - actionbar.pack_end (dim_label); orientation = VERTICAL; append (separator); @@ -178,8 +166,6 @@ public class PantheonShell.Wallpaper : Gtk.Box { } private void load_settings () { - gala_background_settings.bind ("dim-wallpaper-in-dark-style", dim_switch, "active", SettingsBindFlags.DEFAULT); - // TODO: need to store the previous state, before changing to none // when a solid color is selected, because the combobox doesn't know // about it anymore. The previous state should be loaded instead here.