Skip to content

Commit

Permalink
Labels patch is more inteligent.
Browse files Browse the repository at this point in the history
- 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
TomaszGasior committed May 31, 2018
1 parent 02cef46 commit 619277e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = gtk3-mushrooms
pkgdesc = GTK3 patched for classic desktops like MATE/XFCE (see README).
pkgver = 3.22.30
pkgrel = 3
pkgrel = 4
url = https://github.com/TomaszGasior/gtk3-mushrooms
arch = x86_64
license = LGPL
Expand Down Expand Up @@ -80,7 +80,7 @@ pkgbase = gtk3-mushrooms
sha256sums = f0c8cbccab2bc9743075135bd5fa74f28dca722e8e723cf46e0dfa2b004a3791
sha256sums = 7b987cc9bd7ca9722bfb881b30b082c0d7409e3cd68592f5e7a1f401d73e7672
sha256sums = 99b12d7af7efc6a014e6afcab1ee82ea0feb0b5a4e9bbd663d1c45354cd34f2b
sha256sums = c45ed844355b5a4036c2df9a1710a04c4788b78add730506040ebdfb9ec53117
sha256sums = 68046c503f59a3a4eab0bb3dd7b6dd4e006206c3f9adc18898f4302cc4e70a44
sha256sums = d4d27ccc5735ee1d2c8483da659ded3a05e9d33b3fe41d8ed77495e9ec38be96
sha256sums = ba3dc10e116edc96e53867953bfa00d408fcc6ec55913553669be90bea5ad90d
sha256sums = 37e3278dd33542b706eb9e1db56997b194a7e2f1fd729a8511369387a74b22bd
Expand Down
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __arch_pkg_commit="fbcc57e8a97827926b6624bb8bc570f675c7188d"

pkgname=gtk3-mushrooms
pkgver=3.22.30
pkgrel=3
pkgrel=4
pkgdesc="GTK3 patched for classic desktops like MATE/XFCE (see README)."
url="https://github.com/TomaszGasior/gtk3-mushrooms"
conflicts=(gtk3 gtk3-print-backends)
Expand Down Expand Up @@ -81,7 +81,7 @@ sha256sums=(
"f0c8cbccab2bc9743075135bd5fa74f28dca722e8e723cf46e0dfa2b004a3791"
"7b987cc9bd7ca9722bfb881b30b082c0d7409e3cd68592f5e7a1f401d73e7672"
"99b12d7af7efc6a014e6afcab1ee82ea0feb0b5a4e9bbd663d1c45354cd34f2b"
"c45ed844355b5a4036c2df9a1710a04c4788b78add730506040ebdfb9ec53117"
"68046c503f59a3a4eab0bb3dd7b6dd4e006206c3f9adc18898f4302cc4e70a44"
"d4d27ccc5735ee1d2c8483da659ded3a05e9d33b3fe41d8ed77495e9ec38be96"
"ba3dc10e116edc96e53867953bfa00d408fcc6ec55913553669be90bea5ad90d"
"37e3278dd33542b706eb9e1db56997b194a7e2f1fd729a8511369387a74b22bd"
Expand Down
32 changes: 19 additions & 13 deletions fixes__labels-wrapping.patch
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));
*

0 comments on commit 619277e

Please sign in to comment.