Tweak color of share icon in titlebar

Max Brunsfeld created

Change summary

crates/theme/src/theme.rs           |  4 +++-
crates/workspace/src/workspace.rs   | 10 +++++-----
crates/zed/assets/themes/_base.toml |  4 +++-
3 files changed, 11 insertions(+), 7 deletions(-)

Detailed changes

crates/theme/src/theme.rs 🔗

@@ -48,7 +48,8 @@ pub struct Titlebar {
     pub avatar_width: f32,
     pub avatar_ribbon: AvatarRibbon,
     pub offline_icon: OfflineIcon,
-    pub icon_color: Color,
+    pub share_icon_color: Color,
+    pub share_icon_active_color: Color,
     pub avatar: ImageStyle,
     pub sign_in_prompt: ContainedText,
     pub hovered_sign_in_prompt: ContainedText,
@@ -68,6 +69,7 @@ pub struct OfflineIcon {
     #[serde(flatten)]
     pub container: ContainerStyle,
     pub width: f32,
+    pub color: Color,
 }
 
 #[derive(Clone, Deserialize, Default)]

crates/workspace/src/workspace.rs 🔗

@@ -1074,7 +1074,7 @@ impl Workspace {
                     Align::new(
                         ConstrainedBox::new(
                             Svg::new("icons/offline-14.svg")
-                                .with_color(theme.workspace.titlebar.icon_color)
+                                .with_color(theme.workspace.titlebar.offline_icon.color)
                                 .boxed(),
                         )
                         .with_width(theme.workspace.titlebar.offline_icon.width)
@@ -1113,7 +1113,7 @@ impl Workspace {
                     .with_child(
                         Align::new(
                             Flex::row()
-                                .with_children(self.render_share_icon(cx))
+                                .with_children(self.render_share_icon(theme, cx))
                                 .with_children(self.render_collaborators(theme, cx))
                                 .with_child(self.render_avatar(
                                     self.user_store.read(cx).current_user().as_ref(),
@@ -1205,14 +1205,14 @@ impl Workspace {
         }
     }
 
-    fn render_share_icon(&self, cx: &mut RenderContext<Self>) -> Option<ElementBox> {
+    fn render_share_icon(&self, theme: &Theme, cx: &mut RenderContext<Self>) -> Option<ElementBox> {
         if self.project().read(cx).is_local() && self.client.user_id().is_some() {
             enum Share {}
 
             let color = if self.project().read(cx).is_shared() {
-                Color::green()
+                theme.workspace.titlebar.share_icon_active_color
             } else {
-                Color::red()
+                theme.workspace.titlebar.share_icon_color
             };
             Some(
                 MouseEventHandler::new::<Share, _, _, _>(0, cx, |_, _| {

crates/zed/assets/themes/_base.toml 🔗

@@ -12,8 +12,9 @@ title = "$text.0"
 avatar_width = 18
 avatar = { corner_radius = 10, border = { width = 1, color = "#00000088" } }
 avatar_ribbon = { background = "#ff0000", height = 3, width = 12 }
-icon_color = "$text.2.color"
 outdated_warning = { extends = "$text.2", size = 13 }
+share_icon_color = "$text.2.color"
+share_icon_active_color = "$text.0.color"
 
 [workspace.titlebar.sign_in_prompt]
 extends = "$text.2"
@@ -28,6 +29,7 @@ color = "$text.1.color"
 [workspace.titlebar.offline_icon]
 padding = { right = 4 }
 width = 16
+color = "$text.2.color"
 
 [workspace.tab]
 height = 34