Skip to content
Permalink
Browse files

Do not insert hyphens at intra-word line breaks (Bug #15856)

  • Loading branch information
andreldm committed Aug 25, 2019
1 parent 2731686 commit a3e178cb82f6b41b0e3f3cac18e7d83cca70eade
Showing with 28 additions and 0 deletions.
  1. +25 −0 thunar/thunar-pango-extensions.c
  2. +1 −0 thunar/thunar-pango-extensions.h
  3. +2 −0 thunar/thunar-standard-view.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:
*
@@ -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;
@@ -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);

0 comments on commit a3e178c

Please sign in to comment.
You can’t perform that action at this time.