summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-01-06 10:33:07 +0000
committerAntónio Fernandes <antoniof@gnome.org>2021-01-06 11:26:38 +0000
commitb3e94053ffaac6494be9d31151700d5938f5153b (patch)
tree5a9e947a4fcdc26a0abe24a7c1574001a52aafc6
parent28e4d6738bcfdfb59fa95f41aded55ee3823c0f1 (diff)
downloadnautilus-wip/antoniof/max-width-chars-for-conflict-dialog.tar.gz
properties-window: Truncate name in window titlewip/antoniof/max-width-chars-for-conflict-dialog
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
-rw-r--r--src/nautilus-properties-window.c9
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);
}
}
}