From 97ba18fce96f346cb8fbcb999f5f38cf9aad368c Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 6 Nov 2025 21:10:49 +0800 Subject: [PATCH] modal: Adjust close button position. (#1532) --- crates/ui/src/modal.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/modal.rs b/crates/ui/src/modal.rs index 4c2061f6..793a070a 100644 --- a/crates/ui/src/modal.rs +++ b/crates/ui/src/modal.rs @@ -473,10 +473,13 @@ impl RenderOnce for Modal { ) }) .children(self.show_close.then(|| { + let top = (paddings.top - px(10.)).max(px(8.)); + let right = (paddings.right - px(10.)).max(px(8.)); + Button::new("close") .absolute() - .top(paddings.top - px(3.)) - .right(paddings.right - px(3.)) + .top(top) + .right(right) .small() .ghost() .icon(IconName::Close)