Struct BarControl
pub struct BarControl {
pub slot: &'static str,
pub id: String,
pub name: String,
pub icon: Option<String>,
pub menu: bool,
pub labelled: bool,
pub furniture: bool,
pub primary: bool,
pub words: f64,
pub rect: [f64; 4],
}Expand description
One control a window’s bar lays out, as the desktop draws it: what it is, what it does and where it stands. The bar’s own controls (its navigation, its overflow, the window’s) and the app’s slots are all controls of one bar, and a screen shows each of them once.
Fields§
§slot: &'static strThe slot it stands in: sidebar, back, forward, leading, views, views-menu,
action, overflow, notice, reaction, search, history, minimize, maximize,
close.
id: StringWhat pressing it names: the action’s id, or the control’s own target
([crate::widget::window_toolbar_row::SIDEBAR_TARGET] and its siblings).
name: StringWhat it says for itself, where the bar shows it with words.
icon: Option<String>Its icon, by the icon set’s name (none: it shows words only).
It opens a menu: the bar’s own overflow, an app’s menu button, a views menu.
labelled: boolThe bar shows it with its name beside its icon.
furniture: boolIt is the window’s own furniture, not an action of the app’s: the strip’s door that opens another application, whose glyph everyone reads without words. What judges whether the app’s actions say what they do leaves it alone.
primary: boolIt is drawn as the primary button: the app’s one main action, its words or its icon on the accent.
words: f64The width its words need, where it has words the bar shows only when it has room for
them (0.0: it asks for no words, or has none).
rect: [f64; 4]Where it stands, [x, y, width, height] in the window, its bar included.
Implementations§
§impl BarControl
impl BarControl
pub fn new(slot: &'static str, id: impl Into<String>, rect: Rect) -> BarControl
pub fn new(slot: &'static str, id: impl Into<String>, rect: Rect) -> BarControl
The control as one of slot, at rect.
pub fn named(self, name: impl Into<String>) -> BarControl
pub fn named(self, name: impl Into<String>) -> BarControl
It says name for itself.
pub fn icon(self, icon: Option<String>) -> BarControl
pub fn icon(self, icon: Option<String>) -> BarControl
Its icon is icon.
It opens a menu.
pub fn labelled(self) -> BarControl
pub fn labelled(self) -> BarControl
The bar shows it with its name beside its icon.
pub fn furniture(self) -> BarControl
pub fn furniture(self) -> BarControl
It is the window’s own furniture, not an action of the app’s.
pub fn primary(self) -> BarControl
pub fn primary(self) -> BarControl
It is drawn as the primary button.
pub fn words(self, words: f64) -> BarControl
pub fn words(self, words: f64) -> BarControl
Its words need words wide, where the bar shows them only when it has room for them.
Trait Implementations§
§impl Clone for BarControl
impl Clone for BarControl
§fn clone(&self) -> BarControl
fn clone(&self) -> BarControl
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 BarControl
impl Debug for BarControl
§impl PartialEq for BarControl
impl PartialEq for BarControl
§impl Serialize for BarControl
impl Serialize for BarControl
§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 StructuralPartialEq for BarControl
Auto Trait Implementations§
impl Freeze for BarControl
impl RefUnwindSafe for BarControl
impl Send for BarControl
impl Sync for BarControl
impl Unpin for BarControl
impl UnsafeUnpin for BarControl
impl UnwindSafe for BarControl
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<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