pub struct RecipeButtonStyle {
pub recipes: HashMap<ButtonVariant, ButtonRecipe>,
pub label_roles: HashMap<ButtonVariant, TextRole>,
}Expand description
Default ButtonStyle shipped with Teksilo.
Holds a HashMap<ButtonVariant, ButtonRecipe>. Variants that
aren’t explicitly populated fall back to ButtonVariant::Plain
(the Int UI house default).
label_roles optionally redirects the label/icon color per variant
(see [ButtonStyle::label_text_role]). It is empty in the IntUI
default — the Button’s built-in mapping is kept — but
design-language presets (Material 3) populate it so e.g. text and
outlined buttons read in the accent color.
Fields§
§recipes: HashMap<ButtonVariant, ButtonRecipe>§label_roles: HashMap<ButtonVariant, TextRole>Implementations§
Source§impl RecipeButtonStyle
impl RecipeButtonStyle
Sourcepub fn for_tokens(tokens: &InputTokens) -> Self
pub fn for_tokens(tokens: &InputTokens) -> Self
IntUI’s per-variant ButtonRecipe set with every dimension resolved
against a density’s [InputTokens], as
RecipeButtonStyle::for_tokens(&ctx.theme().input) at Button’s own
build site.
Default and intui are the TargetDensity::Compact
projection, so a Compact tree gets exactly the values this module
documents.
Trait Implementations§
Source§impl ButtonStyle for RecipeButtonStyle
impl ButtonStyle for RecipeButtonStyle
fn make_body( &self, cfg: &ButtonStyleConfig, ctx: &mut BuildContext<'_>, ) -> WidgetId
Source§fn label_text_role(&self, variant: ButtonVariant) -> Option<TextRole>
fn label_text_role(&self, variant: ButtonVariant) -> Option<TextRole>
§fn label_text_role_for(
&self,
variant: ButtonVariant,
_state: WidgetState,
) -> Option<TextRole>
fn label_text_role_for( &self, variant: ButtonVariant, _state: WidgetState, ) -> Option<TextRole>
Source§impl Clone for RecipeButtonStyle
impl Clone for RecipeButtonStyle
Source§fn clone(&self) -> RecipeButtonStyle
fn clone(&self) -> RecipeButtonStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecipeButtonStyle
impl Debug for RecipeButtonStyle
Auto Trait Implementations§
impl Freeze for RecipeButtonStyle
impl RefUnwindSafe for RecipeButtonStyle
impl Send for RecipeButtonStyle
impl Sync for RecipeButtonStyle
impl Unpin for RecipeButtonStyle
impl UnsafeUnpin for RecipeButtonStyle
impl UnwindSafe for RecipeButtonStyle
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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