Conversation
| use super::ThemeColors; | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct SelectButtonStyles { |
There was a problem hiding this comment.
rename to SelectStyles
| pub struct SelectButtonStyles { | ||
| // Colors | ||
| // trigger | ||
| pub button_background: Color, |
There was a problem hiding this comment.
rename to background
| // Colors | ||
| // trigger | ||
| pub button_background: Color, | ||
| pub button_text_color: Color, |
| // trigger | ||
| pub button_background: Color, | ||
| pub button_text_color: Color, | ||
| pub button_border_color: Color, |
| self | ||
| } | ||
|
|
||
| pub fn key<S: Into<String>>(mut self, key: S) -> Self { |
There was a problem hiding this comment.
you can also create a common method for this
like key_val() take both key and value
There was a problem hiding this comment.
there are two properties :
label: Option,
key: String,
hence it has two different method
| padding: UiRect::axes(Val::Px(0.0), Val::Px(4.0)), | ||
| ..default() | ||
| }, | ||
| GlobalZIndex(99), |
There was a problem hiding this comment.
can you add comment why is z index needed?
| pub selected: bool, | ||
| pub on_change: Option<SystemId<In<bool>>>, | ||
| pub disabled: bool, | ||
| pub key: Option<String>, |
There was a problem hiding this comment.
should we rename to label?
There was a problem hiding this comment.
yes, changed to label
| let height = select_button_size_style.min_height; | ||
| let font_size = select_button_size_style.font_size; | ||
|
|
||
| let key = self.key.clone().unwrap_or_else(|| "".to_string()); |
There was a problem hiding this comment.
is key is label in terms of html
then if it is not present and value was given
then value will become key?
| height: Val::Px(height), | ||
| ..default() | ||
| }, | ||
| Name::new(self.key.clone().unwrap_or("".to_string())), |
There was a problem hiding this comment.
this is modified to take value if label is not given
70d33ca to
ef2e94d
Compare
Select button with drop down options
on an item selection, close drop down
size variants ( extra small , small, medium, large, extra large)
on outside click of select, close drop down
Preview

on trigger of select button & hover on select item

update after styles & size support:
