Clean up ButtonLike
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
parent
b6ed3b258c
commit
7a0aa1e5df
1 changed files with 4 additions and 14 deletions
|
@ -323,23 +323,13 @@ impl RenderOnce for ButtonLike {
|
||||||
.id(self.id.clone())
|
.id(self.id.clone())
|
||||||
.h(self.size.height())
|
.h(self.size.height())
|
||||||
.rounded_md()
|
.rounded_md()
|
||||||
.when(!self.disabled, |el| el.cursor_pointer())
|
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.px_1()
|
.px_1()
|
||||||
.bg(self.style.enabled(cx).background)
|
.bg(self.style.enabled(cx).background)
|
||||||
.hover(|hover| {
|
.when(!self.disabled, |this| {
|
||||||
hover.bg(if self.disabled {
|
this.cursor_pointer()
|
||||||
self.style.disabled(cx).background
|
.hover(|hover| hover.bg(self.style.hovered(cx).background))
|
||||||
} else {
|
.active(|active| active.bg(self.style.active(cx).background))
|
||||||
self.style.hovered(cx).background
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.active(|active| {
|
|
||||||
active.bg(if self.disabled {
|
|
||||||
self.style.disabled(cx).background
|
|
||||||
} else {
|
|
||||||
self.style.active(cx).background
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.when_some(
|
.when_some(
|
||||||
self.on_click.filter(|_| !self.disabled),
|
self.on_click.filter(|_| !self.disabled),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue