modal: Adjust close button position. (#1532)

This commit is contained in:
Jason Lee 2025-11-06 21:10:49 +08:00 committed by GitHub
parent 34aa68ad35
commit 97ba18fce9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -473,10 +473,13 @@ impl RenderOnce for Modal {
) )
}) })
.children(self.show_close.then(|| { .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") Button::new("close")
.absolute() .absolute()
.top(paddings.top - px(3.)) .top(top)
.right(paddings.right - px(3.)) .right(right)
.small() .small()
.ghost() .ghost()
.icon(IconName::Close) .icon(IconName::Close)