[gimp] app: Include all docks in dock window title



commit cecae710340fff602803d4cd94738c38535c77c4
Author: Martin Nordholts <martinn src gnome org>
Date:   Thu Mar 4 22:59:25 2010 +0100

    app: Include all docks in dock window title

 app/widgets/gimpdockwindow.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index 8980b69..978fcf3 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -683,20 +683,25 @@ gimp_dock_window_update_title (GimpDockWindow *dock_window)
 static gboolean
 gimp_dock_window_update_title_idle (GimpDockWindow *dock_window)
 {
-  GimpDock *dock  = NULL;
-  gchar    *title = NULL;
+  GString *complete_title = g_string_new ("");
+  GList   *iter           = NULL;
 
-  dock = gimp_dock_window_get_dock (dock_window);
-
-  if (! dock)
-    return FALSE;
+  for (iter = gimp_dock_window_get_docks (dock_window);
+       iter;
+       iter = g_list_next (iter))
+    {
+      gchar *title = gimp_dock_get_title (GIMP_DOCK (iter->data));
+      g_string_append (complete_title, title);
+      g_free (title);
 
-  title = gimp_dock_get_title (dock);
+      if (g_list_next (iter))
+        g_string_append (complete_title, " | ");
+    }
 
-  if (title)
-    gtk_window_set_title (GTK_WINDOW (dock_window), title);
+  if (complete_title->len > 0)
+    gtk_window_set_title (GTK_WINDOW (dock_window), complete_title->str);
 
-  g_free (title);
+  g_string_free (complete_title, TRUE /*free_segment*/);
 
   dock_window->p->update_title_idle_id = 0;
 



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