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,32 +473,52 @@ 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()
.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() .w_full()
.line_height(relative(1.2)) .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)) .child(Label::new(self.label.clone()).color(label_color))
.children( .children(
self.meta self.meta
@ -509,6 +529,7 @@ impl<V: 'static> ListDetailsEntry<V> {
.gap_1() .gap_1()
.justify_end() .justify_end()
.children(self.actions.unwrap_or_default()), .children(self.actions.unwrap_or_default()),
),
) )
} }
} }