From eb2c0b33dff361a268b0276f8ec8bb38811d2c5e Mon Sep 17 00:00:00 2001
From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Date: Thu, 28 Nov 2024 19:15:30 -0300
Subject: [PATCH] Fine-tune status bar left-side spacing (#21306)
Closes https://github.com/zed-industries/zed/issues/21291
This PR also adds a small divider separating the panel-opening controls
from the other items that appear on the left side of the status bar. The
spacing was a bit bigger before because all three items on the left open
panels, whereas each other item does different things (e.g., open the
diagnostics tab, update the app, display language server status, etc.).
Therefore, they needed to be separated somehow to communicate the
difference in behavior. Hopefully, now, the border will help sort of
figuring this out.
| With error | Normal state |
|--------|--------|
|
|
|
Release Notes:
- N/A
---
crates/diagnostics/src/items.rs | 8 +++++---
crates/workspace/src/status_bar.rs | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs
index 2c580c44de..495987c516 100644
--- a/crates/diagnostics/src/items.rs
+++ b/crates/diagnostics/src/items.rs
@@ -1,7 +1,7 @@
use editor::Editor;
use gpui::{
- rems, EventEmitter, IntoElement, ParentElement, Render, Styled, Subscription, View,
- ViewContext, WeakView,
+ EventEmitter, IntoElement, ParentElement, Render, Styled, Subscription, View, ViewContext,
+ WeakView,
};
use language::Diagnostic;
use ui::{h_flex, prelude::*, Button, ButtonLike, Color, Icon, IconName, Label, Tooltip};
@@ -77,8 +77,10 @@ impl Render for DiagnosticIndicator {
};
h_flex()
- .h(rems(1.375))
.gap_2()
+ .pl_1()
+ .border_l_1()
+ .border_color(cx.theme().colors().border)
.child(
ButtonLike::new("diagnostic-indicator")
.child(diagnostic_indicator)
diff --git a/crates/workspace/src/status_bar.rs b/crates/workspace/src/status_bar.rs
index 00a0078032..274aee063c 100644
--- a/crates/workspace/src/status_bar.rs
+++ b/crates/workspace/src/status_bar.rs
@@ -64,7 +64,7 @@ impl Render for StatusBar {
impl StatusBar {
fn render_left_tools(&self, cx: &mut ViewContext) -> impl IntoElement {
h_flex()
- .gap(DynamicSpacing::Base08.rems(cx))
+ .gap(DynamicSpacing::Base04.rems(cx))
.overflow_x_hidden()
.children(self.left_items.iter().map(|item| item.to_any()))
}