[gnome-control-center/gbsneto/panel-widget-in-sidebar: 10/14] window: Set the panel name as title for the widget



commit 91d01ae9c7e05c1147efc0ad3b1ca82b58e48764
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Nov 16 14:29:29 2018 -0200

    window: Set the panel name as title for the widget
    
    Instead of the wrong name of the previous panel list view.

 shell/cc-window.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index f145e9cf9..87d3f275c 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -263,7 +263,8 @@ static void
 update_list_title (CcWindow *self)
 {
   CcPanelListView view;
-  const gchar *title;
+  GtkTreeIter iter;
+  g_autofree gchar *title = NULL;
 
   view = cc_panel_list_get_view (CC_PANEL_LIST (self->panel_list));
   title = NULL;
@@ -271,15 +272,23 @@ update_list_title (CcWindow *self)
   switch (view)
     {
     case CC_PANEL_LIST_DETAILS:
-      title = _("Details");
+      title = g_strdup (_("Details"));
       break;
 
     case CC_PANEL_LIST_DEVICES:
-      title = _("Devices");
+      title = g_strdup (_("Devices"));
       break;
 
     case CC_PANEL_LIST_MAIN:
-      title = _("Settings");
+      title = g_strdup (_("Settings"));
+      break;
+
+    case CC_PANEL_LIST_WIDGET:
+      find_iter_for_panel_id (self, self->current_panel_id, &iter);
+      gtk_tree_model_get (GTK_TREE_MODEL (self->store),
+                          &iter,
+                          COL_NAME, &title,
+                          -1);
       break;
 
     case CC_PANEL_LIST_SEARCH:


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