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
This commit is contained in:
António Fernandes 2021-10-27 13:07:27 +01:00
parent 42b0362e98
commit 6afce418af

View file

@ -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",