pub struct ButtonGroup { /* private fields */ }Expand description
A group of toolbar buttons with optional separator
§Example
ButtonGroup::new()
.separator_after()
.show(ui, |ui| {
ui.button("Action 1");
ui.button("Action 2");
});Implementations§
Source§impl ButtonGroup
impl ButtonGroup
Sourcepub fn separator_after(self) -> Self
pub fn separator_after(self) -> Self
Add a separator after this group
Sourcepub fn separator_before(self) -> Self
pub fn separator_before(self) -> Self
Add a separator before this group
Sourcepub fn show<R>(self, ui: &mut Ui, content: impl FnOnce(&mut Ui) -> R) -> R
pub fn show<R>(self, ui: &mut Ui, content: impl FnOnce(&mut Ui) -> R) -> R
Show the button group along the parent’s layout direction
The buttons sit side by side in a horizontal parent and stacked in a vertical one. Each separator is a 1 px line across the group, with a small gap on either side. Returns the result of the content closure.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ButtonGroup
impl RefUnwindSafe for ButtonGroup
impl Send for ButtonGroup
impl Sync for ButtonGroup
impl Unpin for ButtonGroup
impl UnsafeUnpin for ButtonGroup
impl UnwindSafe for ButtonGroup
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