[gnome-games/wip/exalm/libhandy2: 8/9] 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: 8/9] ui: Use PreferencesSidebar in preferences window
- Date: Wed, 12 Sep 2018 12:46:34 +0000 (UTC)
commit 6766af73675fd8aa4ead1ef684d88a2c804ef38f
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 | 2 +-
src/ui/preferences-window.vala | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index 5a56af03..bdd6496e 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -92,7 +92,7 @@
<property name="orientation">vertical</property>
<property name="visible">True</property>
<child>
- <object class="GtkStackSidebar" id="sidebar">
+ <object class="GamesPreferencesSidebar" id="sidebar">
<property name="margin-top">4</property>
<property name="stack">stack</property>
<property name="vexpand">True</property>
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index 554430bf..ee843b41 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -19,6 +19,8 @@ private class Games.PreferencesWindow : Gtk.Window {
[GtkChild]
private Gtk.Box sidebar_vbox;
[GtkChild]
+ private PreferencesSidebar sidebar;
+ [GtkChild]
private Gtk.Stack stack;
[GtkChild]
@@ -62,11 +64,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;
@@ -112,6 +114,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]