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:27:36 +0100
commitb16309d6ab170ddc182ff7fdbf708b3aedc96aba (patch)
tree31c96d89d1863758189ce6317bb931efce1d8aa9 /eel
parent13ae87df1f21a70d5e1fec93d91f70bffc653460 (diff)
downloadcaja-b16309d6ab170ddc182ff7fdbf708b3aedc96aba.tar.bz2
caja-b16309d6ab170ddc182ff7fdbf708b3aedc96aba.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 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)