pub struct SearchBarState {
pub query: Signal<String>,
pub expanded: Signal<bool>,
pub active: Signal<bool>,
pub expands_to_full_screen: Signal<bool>,
pub collapsed_layout_rect: Signal<(f32, f32, f32, f32)>,
/* private fields */
}Expand description
State for SearchBar -> manages expanded/collapsed progress, query text,
active state, and collapsed layout coordinates for popup anchoring.
Fields§
§query: Signal<String>§expanded: Signal<bool>§active: Signal<bool>§expands_to_full_screen: Signal<bool>Whether this search bar expands to full-screen (vs docked). Used by AppBarWithSearch to hide the collapsed bar when expanded.
collapsed_layout_rect: Signal<(f32, f32, f32, f32)>Tracked via on_globally_positioned on the collapsed bar.
Used by expanded docked variants for popup placement.
Implementations§
Source§impl SearchBarState
impl SearchBarState
pub fn new() -> Self
pub fn query(&self) -> String
pub fn set_query(&self, q: impl Into<String>)
pub fn is_expanded(&self) -> bool
pub fn expand(&self)
pub fn collapse(&self)
pub fn is_active(&self) -> bool
pub fn activate(&self)
pub fn deactivate(&self)
Sourcepub fn progress(&self) -> f32
pub fn progress(&self) -> f32
Container animation progress: 0.0 = collapsed, 1.0 = expanded. Ticks the underlying AnimatedValue and requests frames while animating.
Sourcepub fn content_progress(&self) -> f32
pub fn content_progress(&self) -> f32
Content fade progress -> fades ahead of container on collapse.
Sourcepub fn is_animating(&self) -> bool
pub fn is_animating(&self) -> bool
Whether the animation is currently running.
Sourcepub fn current_value(&self) -> SearchBarValue
pub fn current_value(&self) -> SearchBarValue
Whether the search bar is currently expanded (with tolerance for spring overshoot).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SearchBarState
impl !Send for SearchBarState
impl !Sync for SearchBarState
impl !UnwindSafe for SearchBarState
impl Freeze for SearchBarState
impl Unpin for SearchBarState
impl UnsafeUnpin for SearchBarState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more