feat: Add pill button (#56)
This commit is contained in:
@@ -22,6 +22,28 @@ pub fn button(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn pill_button(
|
||||||
|
button_type: impl Component,
|
||||||
|
variant: ButtonVariant,
|
||||||
|
node: Node,
|
||||||
|
title: impl Into<String>,
|
||||||
|
font_size: f32,
|
||||||
|
) -> impl Bundle {
|
||||||
|
(
|
||||||
|
Button,
|
||||||
|
button_type,
|
||||||
|
variant.clone(),
|
||||||
|
node,
|
||||||
|
BackgroundColor(variant.normal_background()),
|
||||||
|
BorderRadius::MAX,
|
||||||
|
children![(
|
||||||
|
Text::new(title),
|
||||||
|
TextFont::from_font_size(font_size),
|
||||||
|
TextColor(variant.text_color())
|
||||||
|
)],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_buttons(
|
pub fn update_buttons(
|
||||||
mut interaction_query: Query<
|
mut interaction_query: Query<
|
||||||
(&Interaction, &ButtonVariant, &mut BackgroundColor),
|
(&Interaction, &ButtonVariant, &mut BackgroundColor),
|
||||||
|
|||||||
Reference in New Issue
Block a user