[gnome-games/wip/exalm/libhandy2: 22/22] ui: Use PreferencesSidebar in preferences window
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/libhandy2: 22/22] ui: Use PreferencesSidebar in preferences window
- Date: Sun, 16 Sep 2018 08:58:44 +0000 (UTC)
commit 9d6e7408fd0ab429d90b7dd948a0f61ac2d92bf7
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Wed Sep 12 15:14:49 2018 +0500
ui: Use PreferencesSidebar in preferences window
data/ui/preferences-window.ui | 3 +--
src/ui/preferences-window.vala | 7 ++++---
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index b87914b4..bcaad6d2 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -90,8 +90,7 @@
<property name="fold">unfolded</property>
<signal name="notify::fold" handler="on_fold_changed" after="yes"/>
<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>
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index e0034b14..345a6c30 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -17,7 +17,7 @@ private class Games.PreferencesWindow : Gtk.Window {
[GtkChild]
private Hdy.Leaflet content_box;
[GtkChild]
- private Gtk.StackSidebar sidebar;
+ private PreferencesSidebar sidebar;
[GtkChild]
private Gtk.Stack stack;
@@ -67,11 +67,11 @@ private class Games.PreferencesWindow : Gtk.Window {
private Binding selection_mode_binding;
public PreferencesWindow () {
- stack.notify["visible-child-name"].connect (visible_child_changed);
+ sidebar.row_selected.connect (row_selected);
update_ui ();
}
- private void visible_child_changed () {
+ private void row_selected () {
content_box.visible_child = stack;
titlebar_box.visible_child = right_header_bar;
@@ -117,6 +117,7 @@ private class Games.PreferencesWindow : Gtk.Window {
left_header_bar.show_close_button = folded;
back_button.visible = folded;
+ sidebar.folded = folded;
if (folded)
stack.transition_type = Gtk.StackTransitionType.NONE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]