Refresh windows when OS appearance changes

This commit is contained in:
Antonio Scandurra
2022-09-14 11:47:43 +02:00
parent 0f9ff57568
commit f67e2bea29
14 changed files with 304 additions and 67 deletions
@@ -1,4 +1,4 @@
use gpui::{elements::*, Entity, RenderContext, View};
use gpui::{color::Color, elements::*, Appearance, Entity, RenderContext, View};
pub struct ContactsStatusItem;
@@ -11,8 +11,15 @@ impl View for ContactsStatusItem {
"ContactsStatusItem"
}
fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
Svg::new("icons/zed_22.svg").aligned().boxed()
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
let color = match cx.appearance {
Appearance::Light | Appearance::VibrantLight => Color::black(),
Appearance::Dark | Appearance::VibrantDark => Color::white(),
};
Svg::new("icons/zed_22.svg")
.with_color(color)
.aligned()
.boxed()
}
}