[gtk+] Simplify a check



commit 8596a34b8ba7f2d42eae2bc5e761d2f106338b8a
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 10 23:19:36 2013 -0500

    Simplify a check
    
    Whenever titlebar is set, title_box is pointing to the
    same widget, so we can just always use title_box here.
    Pointed out by Jasper St. Pierre.

 gtk/gtkwindow.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 90b8320..f7cb65e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1796,13 +1796,8 @@ 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 (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);
-    }
+  if (update_titlebar && 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]