improv(preview_view): set max height for previews

This sets the max height of the previews to THUMBNAIL_SIZE, to match text previews.
Prevents the previews from becoming too large when the desktop details window is resized horizontally.
This commit is contained in:
Vukašin Vojinović 2025-02-07 01:44:01 +01:00
parent 9ca5bfaf19
commit 51f41ac9ee
2 changed files with 16 additions and 15 deletions

View file

@ -1400,11 +1400,11 @@ impl Item {
let mut column = widget::column().spacing(space_m);
column = column.push(widget::row::with_children(vec![
widget::horizontal_space().into(),
self.preview(sizes),
widget::horizontal_space().into(),
]));
column = column.push(
widget::container(self.preview(sizes))
.center_x(Length::Fill)
.max_height(THUMBNAIL_SIZE as f32),
);
let mut details = widget::column().spacing(space_xxxs);
details = details.push(widget::text::heading(self.name.clone()));
@ -3922,15 +3922,13 @@ impl Tab {
}
Element::from(dnd_grid)
}),
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(),
mouse_area::MouseArea::new(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,
)
}