Fix drag select for grid view

When there was a single row of files and there weren't enough files to
fill the row, you couldn't initiate a drag select from the right side of
these files.
This commit is contained in:
Jason Rodney Hansen 2024-07-03 16:31:30 -06:00
parent e81f9701f6
commit 2378aa049d

View file

@ -2296,13 +2296,15 @@ impl Tab {
Element::from(dnd_grid) Element::from(dnd_grid)
.map(|m| cosmic::app::Message::App(crate::app::Message::TabMessage(None, m))) .map(|m| cosmic::app::Message::App(crate::app::Message::TabMessage(None, m)))
}), }),
mouse_area::MouseArea::new(widget::column::with_children(children)) mouse_area::MouseArea::new(
.on_press(|_| Message::Click(None)) widget::container(widget::column::with_children(children)).width(Length::Fill),
.on_drag(Message::Drag) )
.on_drag_end(|_| Message::DragEnd(None)) .on_press(|_| Message::Click(None))
.show_drag_rect(true) .on_drag(Message::Drag)
.on_release(|_| Message::ClickRelease(None)) .on_drag_end(|_| Message::DragEnd(None))
.into(), .show_drag_rect(true)
.on_release(|_| Message::ClickRelease(None))
.into(),
true, true,
) )
} }