Render an offline icon in titlebar when connection is lost

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-09-14 17:47:43 -06:00
co-authored by Max Brunsfeld
parent e212461dfe
commit 99a2dc4880
11 changed files with 102 additions and 40 deletions
+13 -4
View File
@@ -1,6 +1,14 @@
use super::{ItemViewHandle, SplitDirection};
use crate::settings::Settings;
use gpui::{Border, Entity, MutableAppContext, Quad, RenderContext, View, ViewContext, ViewHandle, action, color::Color, elements::*, geometry::{rect::RectF, vector::vec2f}, keymap::Binding, platform::CursorStyle};
use gpui::{
action,
color::Color,
elements::*,
geometry::{rect::RectF, vector::vec2f},
keymap::Binding,
platform::CursorStyle,
Border, Entity, MutableAppContext, Quad, RenderContext, View, ViewContext, ViewHandle,
};
use postage::watch;
use std::{cmp, path::Path, sync::Arc};
@@ -256,7 +264,7 @@ impl Pane {
)
.boxed(),
)
.with_style(&ContainerStyle {
.with_style(ContainerStyle {
margin: Margin {
left: style.spacing,
right: style.spacing,
@@ -283,7 +291,8 @@ impl Pane {
icon.with_color(style.icon_close).boxed()
}
},
).with_cursor_style(CursorStyle::PointingHand)
)
.with_cursor_style(CursorStyle::PointingHand)
.on_click(move |cx| {
cx.dispatch_action(CloseItem(item_id))
})
@@ -298,7 +307,7 @@ impl Pane {
)
.boxed(),
)
.with_style(&style.container)
.with_style(style.container)
.boxed(),
)
.on_mouse_down(move |cx| {
+2 -2
View File
@@ -113,7 +113,7 @@ impl Sidebar {
}))
.boxed(),
)
.with_style(&theme.container)
.with_style(theme.container)
.boxed(),
)
.with_width(theme.width)
@@ -165,7 +165,7 @@ impl Sidebar {
let side = self.side;
MouseEventHandler::new::<Self, _, _, _>(self.side.id(), &mut cx, |_, _| {
Container::new(Empty::new().boxed())
.with_style(&self.theme(settings).resize_handle)
.with_style(self.theme(settings).resize_handle)
.boxed()
})
.with_padding(Padding {