refactor: add button components to theme because they have different overlays than others when they are hovered or pressed

This commit is contained in:
Ashley Wulber 2023-08-07 16:57:25 -04:00 committed by Ashley Wulber
parent 1c5a233a98
commit 20a5227eca
4 changed files with 63 additions and 10 deletions

View file

@ -153,6 +153,16 @@ where
}
}
/// helper for producing a button component
pub fn colored_button(base: C, overlay: C, on_button: C, accent: C) -> Self {
let mut component = Component::colored_component(base, overlay, accent);
component.on = on_button.clone();
let mut on_disabled = on_button.into();
on_disabled.alpha = 0.5;
component.on_disabled = on_disabled.into();
component
}
/// helper for producing a component color theme
pub fn component(
base: C,