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::{
@ -473,32 +473,52 @@ impl<V: 'static> ListDetailsEntry<V> {
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let settings = user_settings(cx);
let (item_bg, item_bg_hover, item_bg_active) = match self.seen {
true => (
let (item_bg, item_bg_hover, item_bg_active) = (
cx.theme().colors().ghost_element,
cx.theme().colors().ghost_element_hover,
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 {
true => LabelColor::Muted,
false => LabelColor::Default,
};
v_stack()
div()
.relative()
.group("")
.bg(item_bg)
.px_1()
.py_1_5()
.px_2()
.py_1p5()
.w_full()
.z_index(1)
.when(!self.seen, |this| {
this.child(
div()
.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(
v_stack()
.w_full()
.line_height(relative(1.2))
.gap_1()
.child(
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
@ -509,6 +529,7 @@ impl<V: 'static> ListDetailsEntry<V> {
.gap_1()
.justify_end()
.children(self.actions.unwrap_or_default()),
),
)
}
}