[gtk+] Use ::has-subtitle when constructing CSD titlebars



commit 05d34f9a5be17bff2436bd7027d62fb3fc079c9e
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 10 22:58:57 2013 -0500

    Use ::has-subtitle when constructing CSD titlebars
    
    GtkWindow was constructing a custom title label to
    avoid the size reservation for a subtitle. This is
    now easier with the ::has-subtitle property.

 gtk/gtkwindow.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 398f1ec..90b8320 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5377,31 +5377,19 @@ static GtkWidget *
 create_titlebar (GtkWindow *window)
 {
   GtkWindowPrivate *priv = window->priv;
-  GtkWidget *label;
   GtkWidget *titlebar;
   GtkStyleContext *context;
-  gchar *title;
 
   titlebar = gtk_header_bar_new ();
   g_object_set (titlebar,
                 "spacing", 0,
+                "title", priv->title ? priv->title : get_default_title (),
+                "has-subtitle", FALSE,
                 NULL);
   context = gtk_widget_get_style_context (titlebar);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLEBAR);
   gtk_style_context_add_class (context, "default-decoration");
 
-  title = g_markup_printf_escaped ("<b>%s</b>",
-                                   priv->title ? priv->title : get_default_title ());
-  label = gtk_label_new (title);
-  g_free (title);
-  g_object_set (label,
-                "use-markup", TRUE,
-                "ellipsize", PANGO_ELLIPSIZE_END,
-                "margin", 6,
-                NULL);
-
-  gtk_header_bar_set_custom_title (GTK_HEADER_BAR (titlebar), label);
-
   return titlebar;
 }
 


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