From 2378aa049d4c6edcf5c552ea83431697f64c9485 Mon Sep 17 00:00:00 2001 From: Jason Rodney Hansen Date: Wed, 3 Jul 2024 16:31:30 -0600 Subject: [PATCH] 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. --- src/tab.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index f97129f..6e9dbe0 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -2296,13 +2296,15 @@ impl Tab { Element::from(dnd_grid) .map(|m| cosmic::app::Message::App(crate::app::Message::TabMessage(None, m))) }), - mouse_area::MouseArea::new(widget::column::with_children(children)) - .on_press(|_| Message::Click(None)) - .on_drag(Message::Drag) - .on_drag_end(|_| Message::DragEnd(None)) - .show_drag_rect(true) - .on_release(|_| Message::ClickRelease(None)) - .into(), + mouse_area::MouseArea::new( + widget::container(widget::column::with_children(children)).width(Length::Fill), + ) + .on_press(|_| Message::Click(None)) + .on_drag(Message::Drag) + .on_drag_end(|_| Message::DragEnd(None)) + .show_drag_rect(true) + .on_release(|_| Message::ClickRelease(None)) + .into(), true, ) }