checkbox: Make checked icon sizable (#785)

| Before | After |
| - | - |
| <img width="642" alt="SCR-20250414-nbwx"
src="https://github.com/user-attachments/assets/fa3daaf8-5465-49f5-8cd5-d59c19b50494"
/> | <img width="644" alt="SCR-20250414-nbli"
src="https://github.com/user-attachments/assets/e45aa560-0183-460a-b76d-e3cb0203067f"
/> |
This commit is contained in:
Floyd Wang 2025-04-14 14:47:15 +08:00 committed by GitHub
parent 73be54a0f7
commit 95fb86ec08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,7 +135,13 @@ impl RenderOnce for Checkbox {
.absolute()
.top_px()
.left_px()
.size_3()
.map(|this| match self.size {
Size::XSmall => this.size_2(),
Size::Small => this.size_2p5(),
Size::Medium => this.size_3(),
Size::Large => this.size_3p5(),
_ => this.size_3(),
})
.text_color(icon_color)
.map(|this| match self.checked {
true => this.path(IconName::Check.path()),