diff options
author | raveit65 <[email protected]> | 2019-12-21 14:52:34 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 21:40:42 +0200 |
commit | acb29caeb06bc874bfe9c3cc769c82dcc1929abb (patch) | |
tree | 345b0af80cb12d3a153dd3f4e07ea6c29806cf97 /eel | |
parent | b41e97d137322990e11f453458268676edc53a58 (diff) | |
download | caja-acb29caeb06bc874bfe9c3cc769c82dcc1929abb.tar.bz2 caja-acb29caeb06bc874bfe9c3cc769c82dcc1929abb.tar.xz |
editable-label: Don't hyphenate filenames
more fixes for https://github.com/mate-desktop/caja/issues/1284
Pango 1.44 got the ability to automatically hyphenate on line breaks,
which is on by default, but can be set off by a new attribute.
As a result, we now hyphenate filenames, which is confusing, because
a filename may already include hyphens.
To restore the previous behavior, let's not insert hyphens when
breaking filenames in multiple lines.
Inspired by https://gitlab.gnome.org/GNOME/nautilus/commit/9738d85
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-editable-label.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c index 0b2cef59..6683b476 100644 --- a/eel/eel-editable-label.c +++ b/eel/eel-editable-label.c @@ -41,6 +41,14 @@ #include <gdk/gdkx.h> #include <gdk/gdkkeysyms.h> +#ifndef PANGO_CHECK_VERSION +#define PANGO_CHECK_VERSION(major, minor, micro) \ + (PANGO_VERSION_MAJOR > (major) || \ + (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR > (minor)) || \ + (PANGO_VERSION_MAJOR == (major) && PANGO_VERSION_MINOR == (minor) && \ + PANGO_VERSION_MICRO >= (micro))) +#endif + enum { @@ -1005,6 +1013,9 @@ eel_editable_label_ensure_layout (EelEditableLabel *label, if (label->font_desc != NULL) pango_layout_set_font_description (label->layout, label->font_desc); + #if PANGO_CHECK_VERSION (1, 44, 0) + pango_attr_list_insert (tmp_attrs, pango_attr_insert_hyphens_new (FALSE)); + #endif pango_layout_set_attributes (label->layout, tmp_attrs); if (preedit_string) |