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