Skip to repository content21 lines · 652 B · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T04:34:16.007Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
search_input.rs
1use gpui::{Pixels, px};
2
3pub struct SearchInputWidth;
4
5impl SearchInputWidth {
6 /// The container size in which the input stops filling the whole width.
7 pub const THRESHOLD_WIDTH: Pixels = px(1200.0);
8
9 /// The maximum width for the search input when the container is larger than the threshold.
10 pub const MAX_WIDTH: Pixels = px(1200.0);
11
12 /// Calculates the actual width in pixels based on the container width.
13 pub fn calc_width(container_width: Pixels) -> Pixels {
14 if container_width < Self::THRESHOLD_WIDTH {
15 container_width
16 } else {
17 container_width.min(Self::MAX_WIDTH)
18 }
19 }
20}
21