-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Labels wrapping fix is activated only for windows without default width. So it's used only when it's needed, avoiding wrapping text unnecessarily.
- Loading branch information
1 parent
02cef46
commit 619277e
Showing
3 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
diff --color -U 5 -r -Z -B ./org/gtk/gtklabel.c ./mod/gtk/gtklabel.c | ||
--- ./org/gtk/gtklabel.c 2018-02-17 23:30:46.000000000 +0100 | ||
+++ ./mod/gtk/gtklabel.c 2018-05-25 21:23:33.053987024 +0200 | ||
@@ -1366,11 +1366,11 @@ | ||
priv = label->priv; | ||
+++ ./mod/gtk/gtklabel.c 2018-06-01 01:03:02.506927146 +0200 | ||
@@ -3683,10 +3683,18 @@ | ||
PangoRectangle *widest) | ||
{ | ||
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->max_width_chars = 52; | ||
+ } | ||
|
||
gtk_widget_set_has_window (GTK_WIDGET (label), FALSE); | ||
|
||
priv->width_chars = -1; | ||
- priv->max_width_chars = -1; | ||
+ priv->max_width_chars = 56; | ||
priv->label = g_strdup (""); | ||
priv->lines = -1; | ||
|
||
priv->xalign = 0.5; | ||
priv->yalign = 0.5; | ||
/* "width-chars" Hard-coded minimum width: | ||
* - minimum size should be MAX (width-chars, strlen ("...")); | ||
* - natural size should be MAX (width-chars, strlen (priv->text)); | ||
* |