From fe342919e6c26684b7a29872ab5aa13605d1c9ac Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Wed, 18 Jun 2025 11:34:11 +0800 Subject: [PATCH] notification: Show the close button when auto-hide is enabled (#977) --- crates/ui/src/notification.rs | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/crates/ui/src/notification.rs b/crates/ui/src/notification.rs index 043ab1c4..a344507d 100644 --- a/crates/ui/src/notification.rs +++ b/crates/ui/src/notification.rs @@ -302,25 +302,21 @@ impl Render for Notification { on_click(event, window, cx); })) }) - .when(!self.autohide, |this| { - this.child( - h_flex() - .absolute() - .top_1() - .right_1() - .invisible() - .group_hover("", |this| this.visible()) - .child( - Button::new("close") - .icon(IconName::Close) - .ghost() - .xsmall() - .on_click( - cx.listener(|this, _, window, cx| this.dismiss(window, cx)), - ), - ), - ) - }) + .child( + h_flex() + .absolute() + .top_1() + .right_1() + .invisible() + .group_hover("", |this| this.visible()) + .child( + Button::new("close") + .icon(IconName::Close) + .ghost() + .xsmall() + .on_click(cx.listener(|this, _, window, cx| this.dismiss(window, cx))), + ), + ) .with_animation( ElementId::NamedInteger("slide-down".into(), closing as u64), Animation::new(Duration::from_secs_f64(0.15))