Tooltip for long filenames, fixes #169

This commit is contained in:
Jeremy Soller 2024-10-10 11:59:57 -06:00
parent ad8be058ef
commit 705c780721
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -3509,14 +3509,16 @@ impl Tab {
))); )));
//TODO: one focus group per grid item (needs custom widget) //TODO: one focus group per grid item (needs custom widget)
let buttons = vec![ let buttons: Vec<Element<Message>> = vec![
widget::button::custom( widget::button::custom(
widget::icon::icon(item.icon_handle_grid.clone()) widget::icon::icon(item.icon_handle_grid.clone())
.content_fit(ContentFit::Contain) .content_fit(ContentFit::Contain)
.size(icon_sizes.grid()), .size(icon_sizes.grid()),
) )
.padding(space_xxxs) .padding(space_xxxs)
.style(button_style(item.selected, false, false, false)), .style(button_style(item.selected, false, false, false))
.into(),
widget::tooltip(
widget::button::custom(widget::text::body(&item.display_name)) widget::button::custom(widget::text::body(&item.display_name))
.id(item.button_id.clone()) .id(item.button_id.clone())
.padding([0, space_xxxs]) .padding([0, space_xxxs])
@ -3526,6 +3528,10 @@ impl Tab {
true, true,
matches!(self.mode, Mode::Desktop), matches!(self.mode, Mode::Desktop),
)), )),
&item.name,
widget::tooltip::Position::Bottom,
)
.into(),
]; ];
let mut column = widget::column::with_capacity(buttons.len()) let mut column = widget::column::with_capacity(buttons.len())