[gtk+/dialogs: 3/25] headerbar: Set a minimum size for the title



commit f93b0ea54c84077946318b5aa53728aa4accb75e
Author: William Jon McCann <william jon mccann gmail com>
Date:   Fri Jan 10 16:15:17 2014 -0500

    headerbar: Set a minimum size for the title
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720059

 gtk/gtkheaderbar.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index d1b1c59..8fedcba 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -51,6 +51,7 @@
  */
 
 #define DEFAULT_SPACING 6
+#define MIN_TITLE_CHARS 20
 
 struct _GtkHeaderBarPrivate
 {
@@ -155,6 +156,7 @@ init_sizing_box (GtkHeaderBar *bar)
   gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
   gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END);
+  gtk_label_set_width_chars (GTK_LABEL (w), MIN_TITLE_CHARS);
 
   w = gtk_label_new (NULL);
   context = gtk_widget_get_style_context (w);
@@ -191,6 +193,7 @@ create_title_box (const char *title,
   gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END);
   gtk_box_pack_start (GTK_BOX (label_box), title_label, FALSE, FALSE, 0);
   gtk_widget_show (title_label);
+  gtk_label_set_width_chars (GTK_LABEL (title_label), MIN_TITLE_CHARS);
 
   subtitle_label = gtk_label_new (subtitle);
   context = gtk_widget_get_style_context (subtitle_label);


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