pub struct Drawer { /* private fields */ }Expand description
A panel anchored to one side of the window.
Implementations§
Source§impl Drawer
impl Drawer
pub fn new( ident: impl Into<Ident>, _window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Sourcepub fn size(self, size: f32) -> Self
pub fn size(self, size: f32) -> Self
The width of a left or right drawer, or the height of a top or bottom one.
pub fn title(self, title: impl Into<SharedString>) -> Self
pub fn description(self, description: impl Into<SharedString>) -> Self
Sourcepub fn content(
self,
body: impl Fn(&mut Window, &mut App) -> AnyElement + 'static,
) -> Self
pub fn content( self, body: impl Fn(&mut Window, &mut App) -> AnyElement + 'static, ) -> Self
Supplies the body, rebuilt on every frame the drawer is on screen.
Supplies the footer, rebuilt on every frame the drawer is on screen.
Sourcepub fn dismissable(self, dismissable: bool) -> Self
pub fn dismissable(self, dismissable: bool) -> Self
Whether escape and the scrim close the drawer. A drawer that is not dismissable installs neither handler.
Sourcepub fn focus_stops(self, stops: impl IntoIterator<Item = FocusHandle>) -> Self
pub fn focus_stops(self, stops: impl IntoIterator<Item = FocusHandle>) -> Self
The controls tab walks between while the drawer is open.
The body is the caller’s, so the caller is the only one that knows which of its handles are focus stops.
pub fn set_focus_stops( &mut self, stops: impl IntoIterator<Item = FocusHandle>, cx: &mut Context<'_, Self>, )
pub fn is_open(&self) -> bool
pub fn is_dismissable(&self) -> bool
Sourcepub fn is_rendered(&self) -> bool
pub fn is_rendered(&self) -> bool
True while the panel must stay in the tree, including for the whole slide out.
pub fn set_title( &mut self, title: impl Into<SharedString>, cx: &mut Context<'_, Self>, )
pub fn open(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Sourcepub fn close(&mut self, _window: &mut Window, cx: &mut Context<'_, Self>)
pub fn close(&mut self, _window: &mut Window, cx: &mut Context<'_, Self>)
Starts the slide out. The drawer stays on screen until it finishes.
Trait Implementations§
impl EventEmitter<DrawerEvent> for Drawer
Source§impl Focusable for Drawer
impl Focusable for Drawer
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for Drawer
impl !Send for Drawer
impl !Sync for Drawer
impl !UnwindSafe for Drawer
impl Freeze for Drawer
impl Unpin for Drawer
impl UnsafeUnpin for Drawer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more