[gnome-games/wip/exalm/unified-window: 21/26] preferences-window: Separate selection mode and can-swipe-back
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/unified-window: 21/26] preferences-window: Separate selection mode and can-swipe-back
- Date: Fri, 10 Apr 2020 18:12:39 +0000 (UTC)
commit 7fb9992c1db430b69e957014604b1fb8394be118
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Apr 10 18:58:10 2020 +0500
preferences-window: Separate selection mode and can-swipe-back
data/ui/preferences-window.ui | 1 -
src/ui/preferences-window.vala | 6 ++++++
2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index eee9a4f0..1a579859 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -106,7 +106,6 @@
<child>
<object class="HdyDeck" id="content_deck">
<property name="visible">True</property>
- <property name="can-swipe-back" bind-source="titlebar" bind-property="selection-mode"
bind-flags="sync-create|invert-boolean"/>
<signal name="notify::transition-running" handler="subpage_transition_finished"/>
<signal name="notify::visible-child" handler="on_visible_child_changed"/>
<child>
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index ef42144a..4da7620a 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -37,6 +37,7 @@ private class Games.PreferencesWindow : Gtk.Window {
if (subpage != null) {
content_deck.navigate (Hdy.NavigationDirection.BACK);
selection_mode_binding.unbind ();
+ swipe_back_binding.unbind ();
}
if (value != null) {
@@ -49,6 +50,10 @@ private class Games.PreferencesWindow : Gtk.Window {
titlebar, "selection-mode",
BindingFlags.SYNC_CREATE);
+ swipe_back_binding = value.bind_property ("allow-back",
+ content_deck, "can-swipe-back",
+ BindingFlags.SYNC_CREATE);
+
content_deck.navigate (Hdy.NavigationDirection.FORWARD);
content_leaflet.navigate (Hdy.NavigationDirection.FORWARD);
}
@@ -59,6 +64,7 @@ private class Games.PreferencesWindow : Gtk.Window {
private Binding subpage_binding;
private Binding selection_mode_binding;
+ private Binding swipe_back_binding;
construct {
update_ui ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]