This commit is contained in:
2026-03-10 15:04:09 +07:00
parent 8850f158ab
commit 249e44d523
4 changed files with 25 additions and 21 deletions

View File

@@ -8,7 +8,7 @@ use gpui::{
Animation, AnimationExt, AnyElement, App, AppContext, ClickEvent, Context, DismissEvent,
ElementId, Entity, EventEmitter, InteractiveElement as _, IntoElement, ParentElement as _,
Render, SharedString, StatefulInteractiveElement, StyleRefinement, Styled, Subscription,
Window, div, px,
Window, div, px, relative,
};
use theme::{ActiveTheme, Anchor};
@@ -332,7 +332,7 @@ impl Render for Notification {
.items_start()
.refine_style(&self.style)
.when_some(icon, |this, icon| {
this.child(div().flex_shrink_0().pt(px(3.)).child(icon))
this.child(div().flex_shrink_0().child(icon))
})
.child(
v_flex()
@@ -342,7 +342,7 @@ impl Render for Notification {
this.child(div().text_sm().font_semibold().child(title))
})
.when_some(self.message.clone(), |this, message| {
this.child(div().text_sm().child(message))
this.child(div().text_sm().line_height(relative(1.25)).child(message))
})
.when_some(content, |this, content| this.child(content))
.when_some(action, |this, action| {
@@ -352,8 +352,8 @@ impl Render for Notification {
.child(
div()
.absolute()
.top_2p5()
.right_2p5()
.top_2()
.right_2()
.invisible()
.group_hover("", |this| this.visible())
.child(
@@ -361,7 +361,9 @@ impl Render for Notification {
.icon(IconName::Close)
.ghost()
.xsmall()
.on_click(cx.listener(|this, _, window, cx| this.dismiss(window, cx))),
.on_click(cx.listener(move |this, _ev, window, cx| {
this.dismiss(window, cx);
})),
),
)
.when_some(self.on_click.clone(), |this, on_click| {