summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-12-10 22:58:57 -0500
committerMatthias Clasen <mclasen@redhat.com>2013-12-10 23:03:12 -0500
commit05d34f9a5be17bff2436bd7027d62fb3fc079c9e (patch)
treeb0f37fe2cf65d82691b8569cfb1324120439ebe1
parent1a6a86a867353de282da31517828316a0773fd8f (diff)
downloadgtk+-05d34f9a5be17bff2436bd7027d62fb3fc079c9e.tar.gz
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.
-rw-r--r--gtk/gtkwindow.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 398f1ecb4d..90b832009a 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;
}