Added basic styling for checkboxes, yay
Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
86e2101592
commit
118435a348
3 changed files with 39 additions and 11 deletions
|
@ -860,9 +860,10 @@ pub struct WelcomeStyle {
|
|||
pub struct CheckboxStyle {
|
||||
pub width: f32,
|
||||
pub height: f32,
|
||||
pub unchecked: ContainerStyle,
|
||||
pub default: ContainerStyle,
|
||||
pub checked: ContainerStyle,
|
||||
pub hovered: ContainerStyle,
|
||||
pub hovered_and_checked: ContainerStyle,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Default)]
|
||||
|
|
|
@ -126,11 +126,17 @@ impl WelcomePage {
|
|||
.with_height(style.height)
|
||||
.contained()
|
||||
.with_style(if checked {
|
||||
style.checked
|
||||
} else if state.hovered() {
|
||||
style.hovered
|
||||
if state.hovered() {
|
||||
style.hovered_and_checked
|
||||
} else {
|
||||
style.checked
|
||||
}
|
||||
} else {
|
||||
style.unchecked
|
||||
if state.hovered() {
|
||||
style.hovered
|
||||
} else {
|
||||
style.default
|
||||
}
|
||||
})
|
||||
.boxed()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue