[gnome-games/wip/exalm/controller-preferences] ui: Remove immersive mode from preferences



commit 909efcbddc956ac381f64bb5799fe80c33dc750e
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           | 28 +---------------------------
 5 files changed, 1 insertion(+), 43 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 7e79ca9e..b5aa4e16 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -7,18 +7,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.Box sidebar_vbox;
-       [GtkChild]
-       private Gtk.Separator separator;
-       [GtkChild]
        private Gtk.Stack stack;
 
        private Gtk.HeaderBar _right_header_bar;
@@ -29,27 +21,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 {
-                       header_separator.visible = !value;
-                       left_header_bar.visible = !value;
-                       separator.visible = !value;
-                       sidebar_vbox.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; }
@@ -80,7 +57,6 @@ private class Games.PreferencesWindow : Gtk.Window {
        }
 
        private Binding right_header_bar_binding;
-       private Binding immersive_mode_binding;
        private Binding subpage_binding;
 
        public PreferencesWindow () {
@@ -102,8 +78,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]