diff options
author | António Fernandes <antoniof@gnome.org> | 2019-09-04 22:45:05 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2019-10-14 10:40:51 +0000 |
commit | c73ad94a72f8e9a989b01858018de74182d17f0e (patch) | |
tree | 733ca84ea1fcde029e4f32e78c3aecea0eb56234 /src/nautilus-view-icon-item-ui.c | |
parent | ee3477068c6d6405826075630c7779e88b050868 (diff) | |
download | nautilus-c73ad94a72f8e9a989b01858018de74182d17f0e.tar.gz |
canvas-item, view-icon-item-ui: Don't hyphenate filenames
Pango 1.44 got the ability to automatically hyphenate on line breaks,
which is on by default, but can be set off by a new attribute.
As a result, we now hyphenate filenames, which is confusing, because
a filename may already include hyphens.
To restore the previous behavior, let's not insert hyphens when
breaking filenames in multiple lines.
Closes https://gitlab.gnome.org/GNOME/nautilus/issues/1177
Diffstat (limited to 'src/nautilus-view-icon-item-ui.c')
-rw-r--r-- | src/nautilus-view-icon-item-ui.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c index 805c68f89..d192e28fa 100644 --- a/src/nautilus-view-icon-item-ui.c +++ b/src/nautilus-view-icon-item-ui.c @@ -128,6 +128,7 @@ constructed (GObject *object) GtkBox *container; GtkBox *item_selection_background; GtkLabel *label; + PangoAttrList *attr_list; GtkStyleContext *style_context; NautilusFile *file; guint icon_size; @@ -149,6 +150,9 @@ constructed (GObject *object) label = GTK_LABEL (gtk_label_new (nautilus_file_get_display_name (file))); gtk_widget_show (GTK_WIDGET (label)); + attr_list = pango_attr_list_new (); + pango_attr_list_insert (attr_list, pango_attr_insert_hyphens_new (FALSE)); + gtk_label_set_attributes (label, attr_list); gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_MIDDLE); gtk_label_set_line_wrap (label, TRUE); gtk_label_set_line_wrap_mode (label, PANGO_WRAP_WORD_CHAR); @@ -178,6 +182,8 @@ constructed (GObject *object) (GCallback) on_view_item_size_changed, self); g_signal_connect (self->model, "notify::file", (GCallback) on_view_item_file_changed, self); + + pango_attr_list_unref (attr_list); } static void |