summaryrefslogtreecommitdiff
path: root/src/xfdesktop-icon-view.c
diff options
context:
space:
mode:
authorAndre Miranda <andreldm@xfce.org>2020-02-12 12:35:29 -0300
committerAndre Miranda <andreldm@xfce.org>2020-02-12 12:35:29 -0300
commiteec0c9b2ca7227b65184e2840f2c3e99aa8678b3 (patch)
tree98e458dd3b9da1d221d9e34aa12a5e4aacdf43ae /src/xfdesktop-icon-view.c
parenta8cebf915025cac72e3baaa13fd4e149acea0bac (diff)
downloadxfdesktop-eec0c9b2ca7227b65184e2840f2c3e99aa8678b3.tar.gz
Do not insert hyphens at intra-word line breaks (Bug #16339)
Diffstat (limited to 'src/xfdesktop-icon-view.c')
-rw-r--r--src/xfdesktop-icon-view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 6e2566bb..b665cc10 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -2887,6 +2887,10 @@ xfdesktop_icon_view_setup_pango_layout(XfdesktopIconView *icon_view,
XfdesktopIcon *icon,
PangoLayout *playout)
{
+#if PANGO_VERSION_CHECK (1, 44, 0)
+ PangoAttrList *attr_list;
+ PangoAttribute *attr;
+#endif
const gchar *label = xfdesktop_icon_peek_label(icon);
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view)
@@ -2907,6 +2911,17 @@ xfdesktop_icon_view_setup_pango_layout(XfdesktopIconView *icon_view,
pango_layout_set_height(playout, TEXT_HEIGHT * PANGO_SCALE);
pango_layout_set_ellipsize(playout, PANGO_ELLIPSIZE_END);
}
+
+#if PANGO_VERSION_CHECK (1, 44, 0)
+ /* Do not add hyphens on line breaks */
+ attr_list = pango_attr_list_new ();
+ attr = pango_attr_insert_hyphens_new (FALSE);
+ attr->start_index = 0;
+ attr->end_index = -1;
+ pango_attr_list_insert (attr_list, attr);
+ pango_layout_set_attributes (playout, attr_list);
+ pango_attr_list_unref (attr_list);
+#endif
}
static gboolean