Use small size for calendar month item to fixed content overflow (#231)

This commit is contained in:
ihavecoke 2024-09-10 00:16:31 +08:00 committed by GitHub
parent 728be16a39
commit 303dd51047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -124,6 +124,9 @@ impl RenderOnce for Checkbox {
this
}
})
.when(self.disabled, |this| {
this.cursor_not_allowed().text_color(cx.theme().muted_foreground)
})
.when_some(
self.on_click.filter(|_| !self.disabled),
|this, on_click| {

View file

@ -593,7 +593,7 @@ impl Calendar {
let active = (ix + 1) as u8 == self.current_month;
self.item_button(ix, month.to_string(), active, false, false, cx)
.w(relative(0.3))
.w(relative(0.3)).text_sm()
.on_click(cx.listener(move |view, _, cx| {
view.current_month = (ix + 1) as u8;
view.set_view_mode(ViewMode::Day, cx);