Commit cacac4f8 authored by Matthias Clasen's avatar Matthias Clasen

csd: Improve the window title

Manually create the label, so that we can set its margins.
parent f0a481d9
...@@ -5198,7 +5198,8 @@ create_decoration (GtkWidget *widget) ...@@ -5198,7 +5198,8 @@ create_decoration (GtkWidget *widget)
GtkWindow *window = GTK_WINDOW (widget); GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv; GtkWindowPrivate *priv = window->priv;
GtkStyleContext *context; GtkStyleContext *context;
const gchar *title; gchar *title;
GtkWidget *label;
/* Client decorations already created */ /* Client decorations already created */
if (priv->client_decorated) if (priv->client_decorated)
...@@ -5244,11 +5245,17 @@ create_decoration (GtkWidget *widget) ...@@ -5244,11 +5245,17 @@ create_decoration (GtkWidget *widget)
gtk_style_context_add_class (context, "titlebar"); gtk_style_context_add_class (context, "titlebar");
gtk_widget_set_parent (priv->title_box, GTK_WIDGET (window)); gtk_widget_set_parent (priv->title_box, GTK_WIDGET (window));
if (priv->title) title = g_markup_printf_escaped ("<b>%s</b>",
title = priv->title; priv->title ? priv->title : get_default_title ());
else label = gtk_label_new (title);
title = get_default_title (); g_free (title);
gtk_header_bar_set_title (GTK_HEADER_BAR (priv->title_box), title); g_object_set (label,
"use-markup", TRUE,
"ellipsize", PANGO_ELLIPSIZE_END,
"margin", 6,
NULL);
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->title_box), label);
gtk_widget_show_all (priv->title_box); gtk_widget_show_all (priv->title_box);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment