Fine-tune status bar left-side spacing (#21306)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run

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 |
|--------|--------|
| <img width="1179" alt="Screenshot 2024-11-28 at 18 52 58"
src="https://github.com/user-attachments/assets/bf4bad19-5588-481a-9d08-91b2227e44e6">
| <img width="1234" alt="Screenshot 2024-11-28 at 18 53 03"
src="https://github.com/user-attachments/assets/4443a16a-9982-44ce-9005-64d4df46f4f0">
|

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-11-28 19:15:30 -03:00 committed by GitHub
parent 3458687300
commit eb2c0b33df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
use editor::Editor; use editor::Editor;
use gpui::{ use gpui::{
rems, EventEmitter, IntoElement, ParentElement, Render, Styled, Subscription, View, EventEmitter, IntoElement, ParentElement, Render, Styled, Subscription, View, ViewContext,
ViewContext, WeakView, WeakView,
}; };
use language::Diagnostic; use language::Diagnostic;
use ui::{h_flex, prelude::*, Button, ButtonLike, Color, Icon, IconName, Label, Tooltip}; use ui::{h_flex, prelude::*, Button, ButtonLike, Color, Icon, IconName, Label, Tooltip};
@ -77,8 +77,10 @@ impl Render for DiagnosticIndicator {
}; };
h_flex() h_flex()
.h(rems(1.375))
.gap_2() .gap_2()
.pl_1()
.border_l_1()
.border_color(cx.theme().colors().border)
.child( .child(
ButtonLike::new("diagnostic-indicator") ButtonLike::new("diagnostic-indicator")
.child(diagnostic_indicator) .child(diagnostic_indicator)

View file

@ -64,7 +64,7 @@ impl Render for StatusBar {
impl StatusBar { impl StatusBar {
fn render_left_tools(&self, cx: &mut ViewContext<Self>) -> impl IntoElement { fn render_left_tools(&self, cx: &mut ViewContext<Self>) -> impl IntoElement {
h_flex() h_flex()
.gap(DynamicSpacing::Base08.rems(cx)) .gap(DynamicSpacing::Base04.rems(cx))
.overflow_x_hidden() .overflow_x_hidden()
.children(self.left_items.iter().map(|item| item.to_any())) .children(self.left_items.iter().map(|item| item.to_any()))
} }