[gnome-games/wip/exalm/pref-sidebar: 6/7] preferences-window: Use PreferencesSidebar as sidebar
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/pref-sidebar: 6/7] preferences-window: Use PreferencesSidebar as sidebar
- Date: Sat, 20 Oct 2018 22:16:23 +0000 (UTC)
commit 9ecf850e6b1559f777da3b7f19799c673e762dae
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]