Show the correct icon in status bar

This commit is contained in:
Antonio Scandurra 2022-09-13 17:00:11 +02:00
parent 97ccb16c97
commit 0f9ff57568
3 changed files with 7 additions and 41 deletions

4
assets/icons/zed_22.svg Normal file
View file

@ -0,0 +1,4 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 11C5 14.3137 7.68629 17 11 17C14.3137 17 17 14.3137 17 11C17 7.68629 14.3137 5 11 5C7.68629 5 5 7.68629 5 11ZM11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11C19 6.58172 15.4183 3 11 3Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.09092 8.09088H14.6364L10.5511 12.4545H12.4546L13.9091 13.9091H7.36365L11.7273 9.54543H9.54547L8.09092 8.09088Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 571 B

View file

@ -1,22 +0,0 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_203_783)">
<g filter="url(#filter0_d_203_783)">
<rect x="3.33984" y="3.33984" width="25.3203" height="25.3203" rx="12.6602" fill="#FEFEFE" stroke="#0E1016" stroke-width="3.61719"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5742 10.5742L22.7822 10.5742L14.9827 18.7129H18.7129L21.4258 21.4258H9.21777L17.0173 13.2871H13.2871L10.5742 10.5742Z" fill="#0E1016"/>
</g>
</g>
<defs>
<filter id="filter0_d_203_783" x="1.18007" y="1.53125" width="29.6399" height="29.6399" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="0.351183"/>
<feGaussianBlur stdDeviation="0.175592"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_203_783"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_203_783" result="shape"/>
</filter>
<clipPath id="clip0_203_783">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,4 +1,4 @@
use gpui::{color::Color, elements::*, Entity, RenderContext, View};
use gpui::{elements::*, Entity, RenderContext, View};
pub struct ContactsStatusItem;
@ -11,24 +11,8 @@ impl View for ContactsStatusItem {
"ContactsStatusItem"
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
MouseEventHandler::new::<Self, _, _>(0, cx, |state, cx| {
Svg::new("icons/zed_32.svg")
.with_color(if state.clicked.is_some() {
Color::red()
} else {
Color::blue()
})
.boxed()
})
.on_down(gpui::MouseButton::Left, |_, _| {})
.on_down_out(gpui::MouseButton::Left, |_, _| {})
.on_up(gpui::MouseButton::Left, |_, _| {})
.on_up_out(gpui::MouseButton::Left, |_, _| {})
.aligned()
.contained()
.with_background_color(Color::green())
.boxed()
fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
Svg::new("icons/zed_22.svg").aligned().boxed()
}
}