composer-widget: Ellipsize long attachment names
If an attachment name is way too long, the attachment name label forces the composer widget to become too wide which breaks on smaller screens. To fix this, ellipsize the label if needed. Since the user has probably just chosen the attachment, they probably have an idea which attachment it is anyway, so we can do this instead of wrapping. Since the file extension can make a big difference, we ellipsize in the middle. When a label is ellipsized, we also add the label as a tooltip in case a user wants to double check the attachment name though. Fixes: https://gitlab.gnome.org/GNOME/geary/-/issues/1577
This commit is contained in:
parent
920343e575
commit
6ae4cd620f
1 changed files with 3 additions and 0 deletions
|
|
@ -1872,6 +1872,9 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
|
|||
Gtk.Label label = new Gtk.Label(label_text);
|
||||
box.pack_start(label);
|
||||
label.halign = Gtk.Align.START;
|
||||
label.ellipsize = Pango.EllipsizeMode.MIDDLE;
|
||||
label.has_tooltip = true;
|
||||
label.query_tooltip.connect(Util.Gtk.query_tooltip_label);
|
||||
|
||||
Gtk.Button remove_button = new Gtk.Button.from_icon_name("user-trash-symbolic", BUTTON);
|
||||
box.pack_start(remove_button, false, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue