summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2019-12-21 14:52:34 +0100
committerraveit65 <[email protected]>2019-12-23 10:46:59 +0100
commiteec47d417bb79b8b6e19e64c33d16e51e7e41f6a (patch)
tree6a4a1692a90869ed17f71a328deb0f3dde019c8b /eel
parent46ddf950b8f962b8733290ee952385ae5bc0deec (diff)
downloadcaja-eec47d417bb79b8b6e19e64c33d16e51e7e41f6a.tar.bz2
caja-eec47d417bb79b8b6e19e64c33d16e51e7e41f6a.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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 0fbdc0c5..c99771fa 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
{
@@ -1007,6 +1015,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)