[nautilus/wip/antoniof/max-width-chars-for-conflict-dialog: 2/2] properties-window: Truncate name in window title
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/max-width-chars-for-conflict-dialog: 2/2] properties-window: Truncate name in window title
- Date: Fri, 8 Jan 2021 12:35:17 +0000 (UTC)
commit ee77cd41c4c16946555f0f3928a6e9484ae580c2
Author: António Fernandes <antoniof gnome org>
Date: Wed Jan 6 10:33:07 2021 +0000
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
src/nautilus-properties-window.c | 9 +++++++--
1 file 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);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]