[gnome-games/wip/exalm/preferences: 3/5] preferences-window: Don't name children content-



commit 5a644404a038af6f95b52851a56ab1ee02a619ff
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Jun 2 16:57:23 2020 +0500

    preferences-window: Don't name children content-
    
    That prefix made sense before HdyWindow, not so much now.

 data/ui/preferences-window.ui  |  4 ++--
 src/ui/preferences-window.vala | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index 1c9f3ab2..413c11ac 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -7,7 +7,7 @@
     <property name="default-height">500</property>
     <property name="window-position">center-on-parent</property>
     <child>
-      <object class="HdyDeck" id="content_deck">
+      <object class="HdyDeck" id="deck">
         <property name="visible">True</property>
         <signal name="notify::transition-running" handler="subpage_transition_finished"/>
         <signal name="notify::visible-child" handler="on_visible_child_changed"/>
@@ -87,7 +87,7 @@
           </object>
         </child>
         <child>
-          <object class="GtkBox" id="content_subpage_box">
+          <object class="GtkBox" id="subpage_box">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
           </object>
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index 348c95f1..0db7b341 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -3,11 +3,11 @@
 [GtkTemplate (ui = "/org/gnome/Games/ui/preferences-window.ui")]
 private class Games.PreferencesWindow : Hdy.Window {
        [GtkChild]
-       private Hdy.Deck content_deck;
+       private Hdy.Deck deck;
        [GtkChild]
        private Gtk.Box main_box;
        [GtkChild]
-       private Gtk.Box content_subpage_box;
+       private Gtk.Box subpage_box;
        [GtkChild]
        private Gtk.Stack stack;
 
@@ -19,18 +19,18 @@ private class Games.PreferencesWindow : Hdy.Window {
                                return;
 
                        if (subpage != null) {
-                               content_deck.navigate (Hdy.NavigationDirection.BACK);
+                               deck.navigate (Hdy.NavigationDirection.BACK);
                                swipe_back_binding.unbind ();
                        }
 
                        if (value != null) {
-                               content_subpage_box.add (value);
+                               subpage_box.add (value);
 
-                               swipe_back_binding = value.bind_property ("allow-back",
-                                                                         content_deck, "can-swipe-back",
+                               swipe_back_binding = value.bind_property ("allow-back", deck,
+                                                                         "can-swipe-back",
                                                                          BindingFlags.SYNC_CREATE);
 
-                               content_deck.navigate (Hdy.NavigationDirection.FORWARD);
+                               deck.navigate (Hdy.NavigationDirection.FORWARD);
                        }
 
                        _subpage = value;
@@ -64,16 +64,16 @@ private class Games.PreferencesWindow : Hdy.Window {
        }
 
        private void remove_subpage () {
-               foreach (var child in content_subpage_box.get_children ())
-                       content_subpage_box.remove (child);
+               foreach (var child in subpage_box.get_children ())
+                       subpage_box.remove (child);
 
                subpage = null;
        }
 
        [GtkCallback]
        public void subpage_transition_finished () {
-               if (content_deck.transition_running ||
-                   content_deck.visible_child != main_box)
+               if (deck.transition_running ||
+                   deck.visible_child != main_box)
                        return;
 
                remove_subpage ();
@@ -81,7 +81,7 @@ private class Games.PreferencesWindow : Hdy.Window {
 
        [GtkCallback]
        private void on_visible_child_changed () {
-               if (content_deck.transition_running || subpage == null)
+               if (deck.transition_running || subpage == null)
                        return;
 
                remove_subpage ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]