popup_menu: More compact checked style (#534)

## Before
<img width="360" alt="image"
src="https://github.com/user-attachments/assets/be388143-efed-4a47-b4f7-11018fe22f99"
/>

## After
<img width="336" alt="image"
src="https://github.com/user-attachments/assets/449b7dd3-c51f-4673-a068-34ac813d79fd"
/>
This commit is contained in:
Floyd Wang 2025-01-08 18:37:14 +08:00 committed by GitHub
parent bf8eb3f459
commit 8aac2f75e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -469,12 +469,11 @@ impl PopupMenu {
let icon = h_flex() let icon = h_flex()
.w_3p5() .w_3p5()
.h_3p5() .h_3p5()
.items_center()
.justify_center() .justify_center()
.text_sm() .text_sm()
.map(|this| { .map(|this| {
if let Some(icon) = icon { if let Some(icon) = icon {
this.child(icon.clone().small()) this.child(icon.clone().xsmall())
} else { } else {
this.children(icon_placeholder.clone()) this.children(icon_placeholder.clone())
} }
@ -553,7 +552,7 @@ impl Render for PopupMenu {
.relative() .relative()
.text_sm() .text_sm()
.py_0() .py_0()
.px_2() .px_1()
.rounded_md() .rounded_md()
.items_center() .items_center()
.on_mouse_enter(cx.listener(move |this, _, cx| { .on_mouse_enter(cx.listener(move |this, _, cx| {
@ -580,7 +579,7 @@ impl Render for PopupMenu {
h_flex() h_flex()
.min_h(ITEM_HEIGHT) .min_h(ITEM_HEIGHT)
.items_center() .items_center()
.gap_x_1p5() .gap_x_1()
.children(Self::render_icon( .children(Self::render_icon(
has_icon, None, cx, has_icon, None, cx,
)) ))
@ -604,7 +603,7 @@ impl Render for PopupMenu {
h_flex() h_flex()
.h(ITEM_HEIGHT) .h(ITEM_HEIGHT)
.items_center() .items_center()
.gap_x_1p5() .gap_x_1()
.children(Self::render_icon( .children(Self::render_icon(
has_icon, has_icon,
icon.clone(), icon.clone(),
@ -632,7 +631,7 @@ impl Render for PopupMenu {
h_flex() h_flex()
.size_full() .size_full()
.items_center() .items_center()
.gap_x_1p5() .gap_x_1()
.children(Self::render_icon( .children(Self::render_icon(
has_icon, has_icon,
icon.clone(), icon.clone(),