[gnome-software/wip/mcrha/gs-update-dialog-ui-title: 33/33] gs-update-dialog: Update window title with the current page title




commit 13d330dc3c215920938f58e4504d0d59ea90f523
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 26 08:44:59 2021 +0200

    gs-update-dialog: Update window title with the current page title
    
    Make sure the window title is the same as the current page title.

 src/gs-update-dialog.c  | 9 +++++++++
 src/gs-update-dialog.ui | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index a302ef7a5..9ba715fb0 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -54,6 +54,15 @@ leaflet_child_transition_cb (AdwLeaflet *leaflet, GParamSpec *pspec, GsUpdateDia
 
        while ((child = adw_leaflet_get_adjacent_child (leaflet, ADW_NAVIGATION_DIRECTION_FORWARD)))
                adw_leaflet_remove (leaflet, child);
+
+       child = adw_leaflet_get_visible_child (leaflet);
+       if (child != NULL) {
+               g_autofree gchar *title = NULL;
+               g_object_get (G_OBJECT (child), "title", &title, NULL);
+               gtk_window_set_title (GTK_WINDOW (dialog), title);
+       } else {
+               gtk_window_set_title (GTK_WINDOW (dialog), "");
+       }
 }
 
 static void
diff --git a/src/gs-update-dialog.ui b/src/gs-update-dialog.ui
index 8def1c777..fbbac57cc 100644
--- a/src/gs-update-dialog.ui
+++ b/src/gs-update-dialog.ui
@@ -5,7 +5,7 @@
     <property name="modal">True</property>
     <property name="destroy_with_parent">True</property>
     <property name="icon_name">dialog-information</property>
-    <property name="title" translatable="yes">Software Repositories</property>
+    <property name="title"></property>
     <property name="default-width">640</property>
     <property name="default-height">576</property>
 


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