pub struct Toolbar<'a> { /* private fields */ }Expand description
A toolbar drawn from a menu’s items.
Implementations§
Source§impl<'a> Toolbar<'a>
impl<'a> Toolbar<'a>
Sourcepub fn new(app: &'a AppHandle, menu: &MenuId) -> Self
pub fn new(app: &'a AppHandle, menu: &MenuId) -> Self
The toolbar of a menu’s items: a row of icons.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Its name for screen readers (Formatting, Tools): its “More
tools” button is then More tools: <name>, so two toolbars of a
window never have two controls of one name. Give it whenever more
than one toolbar shows at a time.
Sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
Which way it runs.
Sourcepub fn labels(self, labels: Labels) -> Self
pub fn labels(self, labels: Labels) -> Self
Icons alone (the default), icons with their titles, or titles.
Sourcepub fn args(self, args: Json) -> Self
pub fn args(self, args: Json) -> Self
Arguments of this toolbar (the document it acts on): merged into
every command a tool runs, and seen by when clauses as
args.<key>, as a context menu’s.
Sourcepub fn show(self, ui: &mut Ui) -> ToolbarLayout
pub fn show(self, ui: &mut Ui) -> ToolbarLayout
Draws it in the room the Ui has, the tools that do not fit in
“More tools”; returns what it drew. A column measures the height
its Ui offers: inside ui.horizontal that is one row’s, so give
it room (ui.allocate_ui, a panel) rather than a row.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Toolbar<'a>
impl<'a> !RefUnwindSafe for Toolbar<'a>
impl<'a> !Send for Toolbar<'a>
impl<'a> !Sync for Toolbar<'a>
impl<'a> Unpin for Toolbar<'a>
impl<'a> UnsafeUnpin for Toolbar<'a>
impl<'a> !UnwindSafe for Toolbar<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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