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,23 +3509,29 @@ 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))
widget::button::custom(widget::text::body(&item.display_name)) .into(),
.id(item.button_id.clone()) widget::tooltip(
.padding([0, space_xxxs]) widget::button::custom(widget::text::body(&item.display_name))
.style(button_style( .id(item.button_id.clone())
item.selected, .padding([0, space_xxxs])
true, .style(button_style(
true, item.selected,
matches!(self.mode, Mode::Desktop), true,
)), true,
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())