diff --git a/thunar/thunar-pango-extensions.c b/thunar/thunar-pango-extensions.c index 545b3a9647dc978f5b4abee68f9fc97d84ac7149..3ff6262c31b2c9b2cbcfd9d260acb5a6ccc8947e 100644 --- a/thunar/thunar-pango-extensions.c +++ b/thunar/thunar-pango-extensions.c @@ -118,6 +118,31 @@ thunar_pango_attr_list_bold (void) +/** + * thunar_pango_attr_disable_hyphens: + * + * Returns a #PangoAttrList for not inserting hyphens at intra-word line breaks. + * The returned list is owned by the callee and must + * not be freed or modified by the caller. + * + * Return value: a #PangoAttrList for not inserting hyphens at intra-word line + * breaks. + **/ +PangoAttrList* +thunar_pango_attr_disable_hyphens (void) +{ + static PangoAttrList *attr_list = NULL; + +#ifdef PANGO_VERSION_1_44 + if (G_UNLIKELY (attr_list == NULL)) + attr_list = thunar_pango_attr_list_wrap (pango_attr_insert_hyphens_new (FALSE), NULL); +#endif + + return attr_list; +} + + + /** * thunar_pango_attr_list_italic: * diff --git a/thunar/thunar-pango-extensions.h b/thunar/thunar-pango-extensions.h index a9d2c1cd2807e519ce754201ebd159209d237adc..aa0e515b5be9642d6ed9a6e327903fc20eaea140 100644 --- a/thunar/thunar-pango-extensions.h +++ b/thunar/thunar-pango-extensions.h @@ -27,6 +27,7 @@ G_BEGIN_DECLS; PangoAttrList *thunar_pango_attr_list_big (void) G_GNUC_CONST; PangoAttrList *thunar_pango_attr_list_big_bold (void) G_GNUC_CONST; PangoAttrList *thunar_pango_attr_list_bold (void) G_GNUC_CONST; +PangoAttrList *thunar_pango_attr_disable_hyphens (void) G_GNUC_CONST; PangoAttrList *thunar_pango_attr_list_italic (void) G_GNUC_CONST; PangoAttrList *thunar_pango_attr_list_small_italic (void) G_GNUC_CONST; PangoAttrList *thunar_pango_attr_list_small (void) G_GNUC_CONST; diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 5e66a11d7a2fd687c3564669f2aa52a1a8e5f7d8..cf55455dc5aab35ad115e6b009c39ea215593555 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -44,6 +44,7 @@ #include <thunar/thunar-icon-renderer.h> #include <thunar/thunar-marshal.h> #include <thunar/thunar-menu-util.h> +#include <thunar/thunar-pango-extensions.h> #include <thunar/thunar-private.h> #include <thunar/thunar-properties-dialog.h> #include <thunar/thunar-renamer-dialog.h> @@ -729,6 +730,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* setup the name renderer */ standard_view->name_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, + "attributes", thunar_pango_attr_disable_hyphens (), "alignment", PANGO_ALIGN_CENTER, "xalign", 0.5, FALSE);