Always set maximum scrollable height for open with dialog, fixes #1229

This commit is contained in:
Jeremy Soller 2025-10-09 13:41:39 -06:00
parent 52d0586a1b
commit f9f27765c7
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA

View file

@ -5224,22 +5224,20 @@ impl Application for App {
.secondary_action( .secondary_action(
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel), widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
) )
.control( .control(widget::scrollable(column).height({
widget::scrollable(column).height(if let Some(size) = self.size { let max_size = self
let max_size = (size.height - 256.0).min(480.0); .size
// (32 (item_height) + 5.0 (custom button padding)) + (space_xxs (list item spacing) * 2) .map_or(480.0, |size| (size.height - 256.0).min(480.0));
let scrollable_height = available_apps.len() as f32 // (32 (item_height) + 5.0 (custom button padding)) + (space_xxs (list item spacing) * 2)
* (item_height + 5.0 + (2.0 * space_xxs as f32)); let scrollable_height = available_apps.len() as f32
* (item_height + 5.0 + (2.0 * space_xxs as f32));
if scrollable_height > max_size { if scrollable_height > max_size {
Length::Fixed(max_size) Length::Fixed(max_size)
} else {
Length::Shrink
}
} else { } else {
Length::Fill Length::Shrink
}), }
); }));
if let Some(app) = store_opt { if let Some(app) = store_opt {
dialog = dialog.tertiary_action( dialog = dialog.tertiary_action(