Struct WindowToolbar
pub struct WindowToolbar {
pub sidebar: Option<bool>,
pub sidebar_unavailable: bool,
pub navigation: Option<ToolbarNavigation>,
pub location: Option<ToolbarLocation>,
pub actions: Vec<ToolbarAction>,
pub leading: Vec<ToolbarAction>,
pub views: Option<ToolbarViews>,
pub notice: Option<ToolbarNotice>,
pub reactions: Option<ToolbarReactions>,
}Expand description
What an app shows in its window’s bar.
Fields§
The app’s sidebar toggle, and whether the sidebar is open: the window’s navigation, leading the row.
The sidebar toggle holds its place but cannot act: a view of the
window that has no sidebar, so the row stands still as the views
change. Only with Self::sidebar.
Back and forward, for an app that keeps a trail of places.
location: Option<ToolbarLocation>Where the window is.
actions: Vec<ToolbarAction>The app’s most used actions, at most MAX_ACTIONS in the row; the
rest in its overflow menu.
leading: Vec<ToolbarAction>Actions on where the window is, right after the navigation (previous,
next, today), at most MAX_LEADING.
views: Option<ToolbarViews>The app’s views of what the window shows, one of them chosen.
notice: Option<ToolbarNotice>A transient notice (notify), shown in the location’s place while
it is up. The window’s notice, not a declaration’s: shown puts
it here.
reactions: Option<ToolbarReactions>The reactions to what the window shows (show_reactions), at the
row’s trailing end. The window’s, as the notice is: shown puts
them here.
Implementations§
§impl WindowToolbar
impl WindowToolbar
Whether the slots are an overflow menu alone: actions, every one of them in the menu, and nothing else. The window of an app that declared no bar carries the desktop’s own items this way, and its title row keeps its title, with the menu button at its end.
pub fn presented(&self) -> WindowToolbar
pub fn presented(&self) -> WindowToolbar
The slots as the bar lays them out: the notice up, if any, in the location’s place (its kind’s icon, then its text). Its action is the notice’s own, laid out right after its text, never among the actions.
pub fn row_actions(&self) -> usize
pub fn row_actions(&self) -> usize
How many of the actions may stand in the row: those not declared for
the menu, which Self::bounded puts first.
pub fn bounded(self) -> WindowToolbar
pub fn bounded(self) -> WindowToolbar
The declaration as the bar takes it: at most
MAX_DECLARED_ACTIONS actions, the row’s before the menu’s,
MAX_LEADING leading actions, MAX_VIEWS views,
MAX_SEGMENTS levels and MAX_SUGGESTIONS suggestions, every
text at most MAX_TEXT_BYTES, a picture at most
MAX_IMAGE_BYTES, no icon the set does not have. A button in the
row needs an icon; a menu entry is named by its text, so one with no
icon stays (ToolbarAction::menu, a menu button’s items).
Trait Implementations§
§impl Clone for WindowToolbar
impl Clone for WindowToolbar
§fn clone(&self) -> WindowToolbar
fn clone(&self) -> WindowToolbar
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for WindowToolbar
impl Debug for WindowToolbar
§impl Default for WindowToolbar
impl Default for WindowToolbar
§fn default() -> WindowToolbar
fn default() -> WindowToolbar
§impl<'de> Deserialize<'de> for WindowToolbar
impl<'de> Deserialize<'de> for WindowToolbar
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WindowToolbar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WindowToolbar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for WindowToolbar
impl PartialEq for WindowToolbar
§impl Serialize for WindowToolbar
impl Serialize for WindowToolbar
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for WindowToolbar
impl StructuralPartialEq for WindowToolbar
Auto Trait Implementations§
impl Freeze for WindowToolbar
impl RefUnwindSafe for WindowToolbar
impl Send for WindowToolbar
impl Sync for WindowToolbar
impl Unpin for WindowToolbar
impl UnsafeUnpin for WindowToolbar
impl UnwindSafe for WindowToolbar
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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