[Xfce4-commits] [xfce/thunar] 01/01: Do not insert hyphens at intra-word line breaks (Bug #15856)
noreply at xfce.org
noreply at xfce.org
Sun Aug 25 20:46:49 CEST 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit a3e178cb82f6b41b0e3f3cac18e7d83cca70eade
Author: Andre Miranda <andreldm at xfce.org>
Date: Sun Aug 25 15:45:31 2019 -0300
Do not insert hyphens at intra-word line breaks (Bug #15856)
---
thunar/thunar-pango-extensions.c | 25 +++++++++++++++++++++++++
thunar/thunar-pango-extensions.h | 1 +
thunar/thunar-standard-view.c | 2 ++
3 files changed, 28 insertions(+)
diff --git a/thunar/thunar-pango-extensions.c b/thunar/thunar-pango-extensions.c
index 545b3a9..3ff6262 100644
--- a/thunar/thunar-pango-extensions.c
+++ b/thunar/thunar-pango-extensions.c
@@ -119,6 +119,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:
*
* Returns a #PangoAttrList for rendering italic text.
diff --git a/thunar/thunar-pango-extensions.h b/thunar/thunar-pango-extensions.h
index a9d2c1c..aa0e515 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 5e66a11..cf55455 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);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list