[gtk+] Update headerbar title from window title



commit da08592ea1d50dd0ddf9bc341a9ffb5bc6c84a20
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 10 20:45:42 2013 -0500

    Update headerbar title from window title
    
    This removes a possible source of confusion in our API.
    The title is now synchronized both ways between the window
    and the headerbar.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720067

 gtk/gtkwindow.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d949000..398f1ec 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1796,8 +1796,13 @@ gtk_window_set_title_internal (GtkWindow   *window,
   if (gtk_widget_get_realized (widget))
     gdk_window_set_title (gtk_widget_get_window (widget), new_title);
 
-  if (priv->titlebar != NULL && update_titlebar)
-    gtk_header_bar_set_title (GTK_HEADER_BAR (priv->titlebar), new_title);
+  if (update_titlebar)
+    {
+      if (GTK_IS_HEADER_BAR (priv->titlebar))
+        gtk_header_bar_set_title (GTK_HEADER_BAR (priv->titlebar), new_title);
+      else if (GTK_IS_HEADER_BAR (priv->title_box))
+        gtk_header_bar_set_title (GTK_HEADER_BAR (priv->title_box), new_title);
+    }
 
   g_object_notify (G_OBJECT (window), "title");
 }


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