blob: 3f8d73426e28d2d107d684d864117e4c2f8c91e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
Index: b/gtk/gtklabel.c
===================================================================
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3685,6 +3685,14 @@ gtk_label_get_preferred_layout_size (Gtk
GtkLabelPrivate *priv = label->priv;
PangoLayout *layout;
gint char_pixels;
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (label));
+ if (GTK_IS_WINDOW (toplevel))
+ {
+ gint default_window_width;
+ gtk_window_get_default_size (GTK_WINDOW (toplevel), &default_window_width, NULL);
+ if (default_window_width == -1 && priv->max_width_chars == -1 && priv->ellipsize == PANGO_ELLIPSIZE_NONE)
+ priv->max_width_chars = 56;
+ }
/* "width-chars" Hard-coded minimum width:
* - minimum size should be MAX (width-chars, strlen ("..."));
|