[gnome-games/wip/exalm/unified-window: 56/60] preferences-window: Separate selection mode and can-swipe-back



commit 928dd67fd5ab55931e634f21bee303121c44b1ba
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]