[gnome-games/wip/exalm/title: 1/2] collection-header-bar: Make title static



commit 50ebd8f22da4546fffce9b41a94df10095b8eeef
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Jul 8 22:31:59 2019 +0500

    collection-header-bar: Make title static
    
    Use "Games" on Platforms page too. This will be needed for centered title
    in the next commit to look good.

 data/ui/collection-header-bar.ui  |  3 ++-
 src/ui/collection-header-bar.vala | 19 -------------------
 2 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/data/ui/collection-header-bar.ui b/data/ui/collection-header-bar.ui
index ba855e98..49d2a7c7 100644
--- a/data/ui/collection-header-bar.ui
+++ b/data/ui/collection-header-bar.ui
@@ -69,8 +69,9 @@
               </object>
             </child>
             <child>
-              <object class="GtkLabel" id="title_label">
+              <object class="GtkLabel">
                 <property name="visible">True</property>
+                <property name="label" translatable="yes">Games</property>
                 <style>
                   <class name="title"/>
                 </style>
diff --git a/src/ui/collection-header-bar.vala b/src/ui/collection-header-bar.vala
index 9042bb79..905844a9 100644
--- a/src/ui/collection-header-bar.vala
+++ b/src/ui/collection-header-bar.vala
@@ -14,9 +14,6 @@ private class Games.CollectionHeaderBar : Gtk.Stack {
 
                        _viewstack = value;
                        view_switcher.stack = _viewstack;
-
-                       if (viewstack != null)
-                               viewstack_child_changed_id = viewstack.notify["visible-child"].connect 
(update_title);
                }
        }
 
@@ -47,8 +44,6 @@ private class Games.CollectionHeaderBar : Gtk.Stack {
        [GtkChild]
        private Hdy.Squeezer title_squeezer;
        [GtkChild]
-       private Gtk.Label title_label;
-       [GtkChild]
        private Hdy.ViewSwitcher view_switcher;
        [GtkChild]
        private Gtk.ToggleButton search;
@@ -79,20 +74,6 @@ private class Games.CollectionHeaderBar : Gtk.Stack {
        private void update_adaptive_state () {
                bool showing_title = title_squeezer.visible_child != view_switcher;
                adaptive_state.is_showing_bottom_bar = showing_title && !is_collection_empty;
-
-               update_title ();
-       }
-
-       private void update_title () {
-               var title = _("Games");
-
-               if (!is_collection_empty) {
-                       var child = viewstack.visible_child;
-
-                       viewstack.child_get (child, "title", out title, null);
-               }
-
-               title_label.label = title;
        }
 
        private void update_subview () {


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