[gnome-games/wip/exalm/pref-sidebar: 5/6] preferences-window: Use PreferencesSidebar as sidebar



commit 4c5a333d163a534eedd028bfc4818e4cc7c8efa4
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Sep 24 23:16:22 2018 +0500

    preferences-window: Use PreferencesSidebar as sidebar

 data/ui/preferences-window.ui  | 7 ++-----
 src/ui/preferences-window.vala | 6 +++---
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index 2bc34700..2db709ae 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -60,15 +60,12 @@
           <object class="GtkBox" id="content_box">
             <property name="visible">True</property>
             <child>
-              <object class="GtkStackSidebar" id="sidebar">
-                <property name="margin-top">4</property>
+              <object class="GamesPreferencesSidebar" id="sidebar">
                 <property name="stack">stack</property>
                 <property name="vexpand">True</property>
                 <property name="visible">True</property>
                 <property name="width-request">150</property>
-                <style>
-                  <class name="preferences" />
-                </style>
+                <signal name="row-selected" handler="sidebar_row_selected"/>
               </object>
             </child>
             <child>
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index 46695cf7..a91a8b51 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -56,11 +56,11 @@ private class Games.PreferencesWindow : Gtk.Window {
        private Binding selection_mode_binding;
 
        public PreferencesWindow () {
-               stack.notify["visible-child-name"].connect (visible_child_changed);
-               visible_child_changed ();
+               sidebar_row_selected ();
        }
 
-       private void visible_child_changed () {
+       [GtkCallback]
+       private void sidebar_row_selected () {
                var page = stack.visible_child as PreferencesPage;
                if (page == null) {
                        right_header_bar.title = "";


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