diff options
author | António Fernandes <antoniof@gnome.org> | 2021-01-06 10:33:07 +0000 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-01-08 12:34:21 +0000 |
commit | ee77cd41c4c16946555f0f3928a6e9484ae580c2 (patch) | |
tree | 95a09886cd918246be27647b8138b3adcc251df6 /src/nautilus-properties-window.c | |
parent | d2be38db9011fd831527f5c040c82cfd2a9b0dfd (diff) | |
download | nautilus-ee77cd41c4c16946555f0f3928a6e9484ae580c2.tar.gz |
properties-window: Truncate name in window title
We display the a file's basename in the properties window title.
exmaple.txt Properties
If a file has a really long name, this makes the dialog way too wide.
example_of_a_very_very_very_very_very_very_very_very_very_very_very_very_very_very_long_name.txt Properties
Yes, that went past the 72 characters limit for a commit message lines,
which proves the point.
Instead, let's truncate the basename to a reasonable limit.
The full name is available in the Basic tab of properties dialog anyway.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=754388
Diffstat (limited to 'src/nautilus-properties-window.c')
-rw-r--r-- | src/nautilus-properties-window.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 738b6f566..d21d6a56c 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -886,17 +886,22 @@ update_properties_window_title (NautilusPropertiesWindow *self) if (file != NULL) { g_autofree gchar *name = NULL; + g_autofree gchar *truncated_name = NULL; name = nautilus_file_get_display_name (file); + truncated_name = eel_str_middle_truncate (name, 30); + if (nautilus_file_is_directory (file)) { /* To translators: %s is the name of the folder. */ - title = g_strdup_printf (C_("folder", "%s Properties"), name); + title = g_strdup_printf (C_("folder", "%s Properties"), + truncated_name); } else { /* To translators: %s is the name of the file. */ - title = g_strdup_printf (C_("file", "%s Properties"), name); + title = g_strdup_printf (C_("file", "%s Properties"), + truncated_name); } } } |