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,9 +5224,10 @@ 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
.map_or(480.0, |size| (size.height - 256.0).min(480.0));
// (32 (item_height) + 5.0 (custom button padding)) + (space_xxs (list item spacing) * 2) // (32 (item_height) + 5.0 (custom button padding)) + (space_xxs (list item spacing) * 2)
let scrollable_height = available_apps.len() as f32 let scrollable_height = available_apps.len() as f32
* (item_height + 5.0 + (2.0 * space_xxs as f32)); * (item_height + 5.0 + (2.0 * space_xxs as f32));
@ -5236,10 +5237,7 @@ impl Application for App {
} else { } else {
Length::Shrink Length::Shrink
} }
} else { }));
Length::Fill
}),
);
if let Some(app) = store_opt { if let Some(app) = store_opt {
dialog = dialog.tertiary_action( dialog = dialog.tertiary_action(