[gnome-games/wip/exalm/libhandy4: 14/19] ui: Remove immersive mode from preferences



commit a0c0ea8fad4323cac408db4965f0fcb365f0d75a
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Sep 12 02:30:45 2018 +0500

    ui: Remove immersive mode from preferences
    
    Now that controller subpages don't use it anymore, it can be removed.

 src/ui/preferences-page-controllers.vala |  5 -----
 src/ui/preferences-page-plugins.vala     |  5 -----
 src/ui/preferences-page-video.vala       |  5 -----
 src/ui/preferences-page.vala             |  1 -
 src/ui/preferences-window.vala           | 29 +----------------------------
 5 files changed, 1 insertion(+), 44 deletions(-)
---
diff --git a/src/ui/preferences-page-controllers.vala b/src/ui/preferences-page-controllers.vala
index 95daa742..f5b3d18f 100644
--- a/src/ui/preferences-page-controllers.vala
+++ b/src/ui/preferences-page-controllers.vala
@@ -9,11 +9,6 @@ private class Games.PreferencesPageControllers: Gtk.Bin, PreferencesPage {
                get { return _header_bar; }
        }
 
-       public bool immersive_mode {
-               protected set {}
-               get { return false; }
-       }
-
        public PreferencesSubpage subpage { get; protected set; }
 
        [GtkChild]
diff --git a/src/ui/preferences-page-plugins.vala b/src/ui/preferences-page-plugins.vala
index ed3478e7..f0bb2bbe 100644
--- a/src/ui/preferences-page-plugins.vala
+++ b/src/ui/preferences-page-plugins.vala
@@ -9,11 +9,6 @@ private class Games.PreferencesPagePlugins: Gtk.Bin, PreferencesPage {
                protected set {}
        }
 
-       public bool immersive_mode {
-               get { return false; }
-               protected set {}
-       }
-
        public PreferencesSubpage subpage { get; protected set; }
 
        [GtkChild]
diff --git a/src/ui/preferences-page-video.vala b/src/ui/preferences-page-video.vala
index 756c00f1..11cc7710 100644
--- a/src/ui/preferences-page-video.vala
+++ b/src/ui/preferences-page-video.vala
@@ -9,11 +9,6 @@ private class Games.PreferencesPageVideo: Gtk.Bin, PreferencesPage {
                get { return _header_bar; }
        }
 
-       public bool immersive_mode {
-               protected set {}
-               get { return false; }
-       }
-
        public PreferencesSubpage subpage { get; protected set; }
 
        private string _filter_active;
diff --git a/src/ui/preferences-page.vala b/src/ui/preferences-page.vala
index 1ef07a85..563b1bd7 100644
--- a/src/ui/preferences-page.vala
+++ b/src/ui/preferences-page.vala
@@ -2,7 +2,6 @@
 
 private interface Games.PreferencesPage: Gtk.Widget {
        public abstract Gtk.HeaderBar header_bar { get; protected set; }
-       public abstract bool immersive_mode { get; protected set; }
        public abstract PreferencesSubpage subpage { get; protected set; }
        public virtual void visible_page_changed () {}
 }
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index 38e1bf54..9771e9b9 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -9,18 +9,10 @@ private class Games.PreferencesWindow : Gtk.Window {
        [GtkChild]
        private Gtk.Box titlebar_box;
        [GtkChild]
-       private Gtk.HeaderBar left_header_bar;
-       [GtkChild]
-       private Gtk.Separator header_separator;
-       [GtkChild]
        private Gtk.Stack main_stack;
        [GtkChild]
        private Gtk.Box content_box;
        [GtkChild]
-       private Gtk.StackSidebar sidebar;
-       [GtkChild]
-       private Gtk.Separator separator;
-       [GtkChild]
        private Gtk.Stack stack;
 
        private Gtk.HeaderBar _right_header_bar;
@@ -31,28 +23,12 @@ private class Games.PreferencesWindow : Gtk.Window {
                                titlebar_box.remove (_right_header_bar);
                        if (value != null) {
                                titlebar_box.pack_end (value);
-                               value.show_close_button = !immersive_mode;
+                               value.show_close_button = true;
                        }
                        _right_header_bar = value;
                }
        }
 
-       private bool _immersive_mode;
-       public bool immersive_mode {
-               get { return _immersive_mode; }
-               set {
-                       titlebar.selection_mode = value;
-                       header_separator.visible = !value;
-                       left_header_bar.visible = !value;
-                       separator.visible = !value;
-                       sidebar.visible = !value;
-                       if (right_header_bar != null)
-                               right_header_bar.show_close_button = !value;
-
-                       _immersive_mode = value;
-               }
-       }
-
        private PreferencesSubpage _subpage;
        public PreferencesSubpage subpage {
                get { return _subpage; }
@@ -89,7 +65,6 @@ private class Games.PreferencesWindow : Gtk.Window {
        private PreferencesSubpage previous_subpage;
 
        private Binding right_header_bar_binding;
-       private Binding immersive_mode_binding;
        private Binding subpage_binding;
        private Binding selection_mode_binding;
 
@@ -112,8 +87,6 @@ private class Games.PreferencesWindow : Gtk.Window {
                }
                right_header_bar_binding = page.bind_property ("header-bar", this, "right_header_bar",
                                                               BindingFlags.SYNC_CREATE);
-               immersive_mode_binding = page.bind_property ("immersive-mode", this, "immersive-mode",
-                                                            BindingFlags.SYNC_CREATE);
                subpage_binding = page.bind_property ("subpage", this, "subpage",
                                                      BindingFlags.SYNC_CREATE);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]