Struct BarControlFace
pub struct BarControlFace<'a> { /* private fields */ }Expand description
A bar control’s content and state, borrowed.
Implementations§
§impl<'a> BarControlFace<'a>
impl<'a> BarControlFace<'a>
pub fn new(name: &'a str) -> BarControlFace<'a>
pub fn new(name: &'a str) -> BarControlFace<'a>
A bar control named name for assistive technology (and as its
tooltip when it shows only an icon).
pub fn icon(self, icon: Icon) -> BarControlFace<'a>
pub fn label(self, label: &'a str) -> BarControlFace<'a>
pub fn label(self, label: &'a str) -> BarControlFace<'a>
The visible label. An empty string shows none.
pub fn trailing(self, icon: Icon) -> BarControlFace<'a>
pub fn trailing(self, icon: Icon) -> BarControlFace<'a>
A trailing icon: the chevron of a control that opens a menu.
pub fn open(self, open: bool) -> BarControlFace<'a>
pub fn open(self, open: bool) -> BarControlFace<'a>
Its menu or panel is open: it holds the whole lift.
pub fn hovered(self, hovered: bool) -> BarControlFace<'a>
pub fn pressed(self, pressed: bool) -> BarControlFace<'a>
pub fn focused(self, focused: bool) -> BarControlFace<'a>
pub fn focused(self, focused: bool) -> BarControlFace<'a>
Keyboard focus. The ring shows only while focus is visible
(crate::focus_visible).
pub fn height(theme: &Theme) -> f64
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn width(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The control’s width for its content: a square for an icon alone, otherwise its content plus the related inset each side.
pub fn fill(
&self,
theme: &Theme,
ground: AlphaColor<Srgb>,
) -> Option<AlphaColor<Srgb>>
pub fn fill( &self, theme: &Theme, ground: AlphaColor<Srgb>, ) -> Option<AlphaColor<Srgb>>
The fill behind the control on ground (the bar’s ground: the
desktop for the top bar, the window for a window bar).
pub fn paint(
&self,
ctx: &mut PaintCtx<'_>,
rect: Rect,
ground: AlphaColor<Srgb>,
)
pub fn paint( &self, ctx: &mut PaintCtx<'_>, rect: Rect, ground: AlphaColor<Srgb>, )
Paint the control in rect (its width from Self::width, its
height Self::height) standing on ground. Inks are measured on
what is under them.
pub fn paint_lift(
&self,
scene: &mut Scene,
transform: Affine,
rect: Rect,
theme: &Theme,
ground: AlphaColor<Srgb>,
)
pub fn paint_lift( &self, scene: &mut Scene, transform: Affine, rect: Rect, theme: &Theme, ground: AlphaColor<Srgb>, )
Paint only the control’s lift in rect on ground: the fill
Self::paint lays under its content, for a bar control that draws
its content itself (an application’s tray icon, a mark). The caller
draws what stands on it.
pub fn accessibility(&self, rect: Rect) -> AccessNode
Trait Implementations§
§impl<'a> Clone for BarControlFace<'a>
impl<'a> Clone for BarControlFace<'a>
§fn clone(&self) -> BarControlFace<'a>
fn clone(&self) -> BarControlFace<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<'a> Debug for BarControlFace<'a>
impl<'a> Debug for BarControlFace<'a>
impl<'a> Copy for BarControlFace<'a>
Auto Trait Implementations§
impl<'a> Freeze for BarControlFace<'a>
impl<'a> RefUnwindSafe for BarControlFace<'a>
impl<'a> Send for BarControlFace<'a>
impl<'a> Sync for BarControlFace<'a>
impl<'a> Unpin for BarControlFace<'a>
impl<'a> UnsafeUnpin for BarControlFace<'a>
impl<'a> UnwindSafe for BarControlFace<'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
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