assistant2: Fix overflowing notification title (#27763)
<img src="https://github.com/user-attachments/assets/5a22caba-2535-4f45-96a1-6ee9a552266f" width="500"/> Release Notes: - N/A
This commit is contained in:
parent
342acdd080
commit
74dd32d52c
1 changed files with 20 additions and 11 deletions
|
@ -76,6 +76,19 @@ impl Render for AgentNotification {
|
|||
let line_height = window.line_height();
|
||||
|
||||
let bg = cx.theme().colors().elevated_surface_background;
|
||||
let gradient_overflow = || {
|
||||
div()
|
||||
.h_full()
|
||||
.absolute()
|
||||
.w_8()
|
||||
.bottom_0()
|
||||
.right_0()
|
||||
.bg(linear_gradient(
|
||||
90.,
|
||||
linear_color_stop(bg, 1.),
|
||||
linear_color_stop(bg.opacity(0.2), 0.),
|
||||
))
|
||||
};
|
||||
|
||||
h_flex()
|
||||
.id("agent-notification")
|
||||
|
@ -107,27 +120,23 @@ impl Render for AgentNotification {
|
|||
v_flex()
|
||||
.child(
|
||||
div()
|
||||
.relative()
|
||||
.text_size(px(14.))
|
||||
.text_color(cx.theme().colors().text)
|
||||
.child(self.title.clone()),
|
||||
.max_w(px(300.))
|
||||
.truncate()
|
||||
.child(self.title.clone())
|
||||
.child(gradient_overflow()),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.relative()
|
||||
.text_size(px(12.))
|
||||
.text_color(cx.theme().colors().text_muted)
|
||||
.max_w(px(340.))
|
||||
.truncate()
|
||||
.child(self.caption.clone())
|
||||
.relative()
|
||||
.child(
|
||||
div().h_full().absolute().w_8().bottom_0().right_0().bg(
|
||||
linear_gradient(
|
||||
90.,
|
||||
linear_color_stop(bg, 1.),
|
||||
linear_color_stop(bg.opacity(0.2), 0.),
|
||||
),
|
||||
),
|
||||
),
|
||||
.child(gradient_overflow()),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue