File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,31 @@ thunar_pango_attr_list_bold (void)
118118
119119
120120
121+ /**
122+ * thunar_pango_attr_disable_hyphens:
123+ *
124+ * Returns a #PangoAttrList for not inserting hyphens at intra-word line breaks.
125+ * The returned list is owned by the callee and must
126+ * not be freed or modified by the caller.
127+ *
128+ * Return value: a #PangoAttrList for not inserting hyphens at intra-word line
129+ * breaks.
130+ **/
131+ PangoAttrList *
132+ thunar_pango_attr_disable_hyphens (void )
133+ {
134+ static PangoAttrList * attr_list = NULL ;
135+
136+ #ifdef PANGO_VERSION_1_44
137+ if (G_UNLIKELY (attr_list == NULL ))
138+ attr_list = thunar_pango_attr_list_wrap (pango_attr_insert_hyphens_new (FALSE), NULL );
139+ #endif
140+
141+ return attr_list ;
142+ }
143+
144+
145+
121146/**
122147 * thunar_pango_attr_list_italic:
123148 *
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ G_BEGIN_DECLS;
2727PangoAttrList * thunar_pango_attr_list_big (void ) G_GNUC_CONST ;
2828PangoAttrList * thunar_pango_attr_list_big_bold (void ) G_GNUC_CONST ;
2929PangoAttrList * thunar_pango_attr_list_bold (void ) G_GNUC_CONST ;
30+ PangoAttrList * thunar_pango_attr_disable_hyphens (void ) G_GNUC_CONST ;
3031PangoAttrList * thunar_pango_attr_list_italic (void ) G_GNUC_CONST ;
3132PangoAttrList * thunar_pango_attr_list_small_italic (void ) G_GNUC_CONST ;
3233PangoAttrList * thunar_pango_attr_list_small (void ) G_GNUC_CONST ;
Original file line number Diff line number Diff line change 4444#include <thunar/thunar-icon-renderer.h>
4545#include <thunar/thunar-marshal.h>
4646#include <thunar/thunar-menu-util.h>
47+ #include <thunar/thunar-pango-extensions.h>
4748#include <thunar/thunar-private.h>
4849#include <thunar/thunar-properties-dialog.h>
4950#include <thunar/thunar-renamer-dialog.h>
@@ -729,6 +730,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
729730
730731 /* setup the name renderer */
731732 standard_view -> name_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT ,
733+ "attributes" , thunar_pango_attr_disable_hyphens (),
732734 "alignment" , PANGO_ALIGN_CENTER ,
733735 "xalign" , 0.5 ,
734736 FALSE);
You can’t perform that action at this time.
0 commit comments