Update notifications panel

This commit is contained in:
Nate Butler 2023-11-01 02:10:23 -04:00
parent bfb1f5ecf0
commit 3bcc2fa17b

View file

@ -1,4 +1,4 @@
use gpui2::{div, relative, Div}; use gpui2::{div, px, relative, Div};
use crate::settings::user_settings; use crate::settings::user_settings;
use crate::{ use crate::{
@ -473,42 +473,63 @@ impl<V: 'static> ListDetailsEntry<V> {
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> { fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let settings = user_settings(cx); let settings = user_settings(cx);
let (item_bg, item_bg_hover, item_bg_active) = match self.seen { let (item_bg, item_bg_hover, item_bg_active) = (
true => ( cx.theme().colors().ghost_element,
cx.theme().colors().ghost_element, cx.theme().colors().ghost_element_hover,
cx.theme().colors().ghost_element_hover, cx.theme().colors().ghost_element_active,
cx.theme().colors().ghost_element_active, );
),
false => (
cx.theme().colors().element,
cx.theme().colors().element_hover,
cx.theme().colors().element_active,
),
};
let label_color = match self.seen { let label_color = match self.seen {
true => LabelColor::Muted, true => LabelColor::Muted,
false => LabelColor::Default, false => LabelColor::Default,
}; };
v_stack() div()
.relative() .relative()
.group("") .group("")
.bg(item_bg) .bg(item_bg)
.px_1() .px_2()
.py_1_5() .py_1p5()
.w_full() .w_full()
.line_height(relative(1.2)) .z_index(1)
.child(Label::new(self.label.clone()).color(label_color)) .when(!self.seen, |this| {
.children( this.child(
self.meta div()
.map(|meta| Label::new(meta).color(LabelColor::Muted)), .absolute()
) .left(px(3.0))
.top_3()
.rounded_full()
.border_2()
.border_color(cx.theme().colors().surface)
.w(px(9.0))
.h(px(9.0))
.z_index(2)
.bg(cx.theme().status().info),
)
})
.child( .child(
h_stack() v_stack()
.w_full()
.line_height(relative(1.2))
.gap_1() .gap_1()
.justify_end() .child(
.children(self.actions.unwrap_or_default()), div()
.w_5()
.h_5()
.rounded_full()
.bg(cx.theme().colors().icon_accent),
)
.child(Label::new(self.label.clone()).color(label_color))
.children(
self.meta
.map(|meta| Label::new(meta).color(LabelColor::Muted)),
)
.child(
h_stack()
.gap_1()
.justify_end()
.children(self.actions.unwrap_or_default()),
),
) )
} }
} }