pub struct ResponsiveToolbar { /* private fields */ }Expand description
Horizontal or vertical toolbar container with an egui state scope.
Contents use the available layout directly, without a scroll area.
§Example
ResponsiveToolbar::horizontal("my_toolbar")
.height(48.0)
.show(ui, |ui, ctx| {
// Render toolbar contents
});Implementations§
Source§impl ResponsiveToolbar
impl ResponsiveToolbar
Sourcepub fn horizontal(id: impl Hash + Debug) -> Self
pub fn horizontal(id: impl Hash + Debug) -> Self
Create a new horizontal toolbar with the given ID
Sourcepub fn show<R>(
self,
ui: &mut Ui,
content: impl FnOnce(&mut Ui, &LayoutContext) -> R,
) -> R
pub fn show<R>( self, ui: &mut Ui, content: impl FnOnce(&mut Ui, &LayoutContext) -> R, ) -> R
Show the toolbar contents without a scroll area.
The callback receives:
ui: The UI context to render intoctx: The layout context
Returns the value returned by the callback.
Auto Trait Implementations§
impl Freeze for ResponsiveToolbar
impl RefUnwindSafe for ResponsiveToolbar
impl Send for ResponsiveToolbar
impl Sync for ResponsiveToolbar
impl Unpin for ResponsiveToolbar
impl UnsafeUnpin for ResponsiveToolbar
impl UnwindSafe for ResponsiveToolbar
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> 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