pub struct StatusColors {
pub normal: (Style, Style),
pub select: (Style, Style),
pub norm_disabled: (Style, Style),
pub sel_disabled: (Style, Style),
}Expand description
The four (lo, hi) style pairs a status item is drawn in — normal, selected,
normal-disabled, and selected-disabled — resolved once per draw from the
Theme via the Status* Roles. Each pair is
(label style, shortcut-highlight style).
Analogous to MenuColors but reads the distinct
Status* roles — deliberately a separate type (different roles), not a reuse.
All four pairs are resolved as a unit. The select / sel_disabled pairs are
used by the hover/press highlight for the item under the cursor.
Fields§
§normal: (Style, Style)Normal: (StatusNormal, StatusShortcut).
select: (Style, Style)Selected/highlighted: (StatusSelect, StatusShortcutSelect).
norm_disabled: (Style, Style)Normal but disabled: StatusDisabled for both lo and hi.
sel_disabled: (Style, Style)Selected but disabled: StatusSelDisabled for both lo and hi.
Implementations§
Source§impl StatusColors
impl StatusColors
Sourcepub fn resolve(ctx: &DrawCtx<'_>) -> Self
pub fn resolve(ctx: &DrawCtx<'_>) -> Self
Build a StatusColors by reading all four Status* role pairs from the
draw context’s theme in one pass.
Call this once at the top of a draw implementation and pass the result to
item for each status item. This is how StatusLine::draw
uses it — the C++ equivalent resolved palette indices for each item
individually; this batches them all up front.
Trait Implementations§
Source§impl Clone for StatusColors
impl Clone for StatusColors
Source§fn clone(&self) -> StatusColors
fn clone(&self) -> StatusColors
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StatusColors
Auto Trait Implementations§
impl Freeze for StatusColors
impl RefUnwindSafe for StatusColors
impl Send for StatusColors
impl Sync for StatusColors
impl Unpin for StatusColors
impl UnsafeUnpin for StatusColors
impl UnwindSafe for StatusColors
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.