Forms: an option list stays inside the window; media ratios are checked in one place

The floating list under a Select, Combobox or MultiSelect was at least its
trigger's width with no ceiling, so a long choice ran it past the window
and its rows never ellipsized. It now stops at the window's width less the
window margin on each side, so gpui snaps it inside. The camera preview
and the model viewer check their ratio through primitives::checked_ratio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-26 19:17:52 -04:00
1 parent 7f1cfe8c3d
commit 9872adc5e9
6 files changed
+37 -7

No files matched your search

+2
View File
@@ -286,10 +286,12 @@ impl Popup<'_> {
})
});
let list = surface(self.id, cx)
.debug_selector(|| "option-list".into())
.min_w(theme.tooltip_max_width())
.when(anchor.size.width > Pixels::ZERO, |list| {
list.min_w(anchor.size.width)
})
.max_w(window.viewport_size().width - theme.window_margin() * 2.0)
.max_h(theme.list_max_height())
.overflow_y_scroll()
.when_some(self.scroll, |list, handle| list.track_scroll(handle))