[connections/update-topbar-title] topbar: Update title bar when switching stack pages




commit 2a17488c52bd3a32204815ae4c598d9f22d1f7ae
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jul 29 14:30:35 2021 +0200

    topbar: Update title bar when switching stack pages

 src/topbar.vala | 12 +++++++++++-
 src/window.vala |  3 +++
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/topbar.vala b/src/topbar.vala
index 5007b5e..bdabcd2 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -99,12 +99,22 @@ namespace Connections {
             back_button_clicked ();
         }
 
+        public void show_collection_view () {
+            this.connection = null;
+
+            set_visible_child (collection_toolbar);
+        }
+
         public void show_display_view (Connection connection) {
             this.connection = connection;
 
             set_visible_child (display_toolbar);
 
-            display_toolbar.set_title (connection.display_name);
+            display_toolbar.set_title (connection.get_visible_name ());
+        }
+
+        public void set_title (string title) {
+            collection_toolbar.set_title (title);
         }
 
         private void ctrl_alt_backspace_activated () {
diff --git a/src/window.vala b/src/window.vala
index 034037d..267c1d4 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -103,6 +103,9 @@ namespace Connections {
 
         public void show_collection_view () {
             stack.set_visible_child (collection_view);
+
+            topbar.show_collection_view ();
+            topbar.set_title (_("Connections"));
         }
 
         public void show_preferences_window (Connection connection) {


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