summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-10-27 13:07:27 +0100
committerAntónio Fernandes <antoniof@gnome.org>2021-10-27 13:21:18 +0100
commit6afce418af083dae49dcbf4143383f8baddc3ecd (patch)
tree3dada4d88c4273d66defeaebcc044526a376ba07
parent42b0362e9844f4c5114b21464185620eaadcfcaa (diff)
downloadnautilus-6afce418af083dae49dcbf4143383f8baddc3ecd.tar.gz
trash-bar: Ellipsize subtitle label
The subtitle label is long and may be even longer in some locales. As a result, a wide minimum width is forced on the whole window, which is not desirable. So, make it ellipsize and also add a tooltip. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2012
-rw-r--r--src/nautilus-trash-bar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nautilus-trash-bar.c b/src/nautilus-trash-bar.c
index d458fa862..7fca03e67 100644
--- a/src/nautilus-trash-bar.c
+++ b/src/nautilus-trash-bar.c
@@ -212,6 +212,7 @@ static void
nautilus_trash_bar_init (NautilusTrashBar *bar)
{
GtkWidget *content_area, *action_area, *w;
+ const gchar *subtitle_text;
GtkWidget *label;
GtkWidget *subtitle;
PangoAttrList *attrs;
@@ -228,7 +229,10 @@ nautilus_trash_bar_init (NautilusTrashBar *bar)
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
- subtitle = gtk_label_new (_("Trashed items are automatically deleted after a period of time"));
+ subtitle_text = _("Trashed items are automatically deleted after a period of time");
+ subtitle = gtk_label_new (subtitle_text);
+ gtk_widget_set_tooltip_text (subtitle, subtitle_text);
+ gtk_label_set_ellipsize (GTK_LABEL (subtitle), PANGO_ELLIPSIZE_END);
g_settings_bind (gnome_privacy_preferences,
"remove-old-trash-files",