[gnome-games/wip/exalm/libhandy2: 4/7] preferences-window: Use PreferencesSidebar for sidebar



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

    preferences-window: Use PreferencesSidebar for 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 3e10d978..09fb003f 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]