Scale down status bar items (#3766)

Marshall Bowers created

This PR scales down the sizes of items in the status bar.

This brings us more in line with Zed1.

Release Notes:

- N/A

Change summary

crates/activity_indicator2/src/activity_indicator.rs    |  4 
crates/copilot_button2/src/copilot_button.rs            |  4 
crates/diagnostics2/src/items.rs                        | 45 ++++++++--
crates/editor2/src/items.rs                             |  2 
crates/feedback2/src/deploy_feedback_button.rs          |  1 
crates/language_selector2/src/active_buffer_language.rs |  3 
crates/vim2/src/mode_indicator.rs                       |  6 
crates/workspace2/src/dock.rs                           |  1 
8 files changed, 48 insertions(+), 18 deletions(-)

Detailed changes

crates/activity_indicator2/src/activity_indicator.rs πŸ”—

@@ -10,7 +10,7 @@ use language::{LanguageRegistry, LanguageServerBinaryStatus};
 use project::{LanguageServerProgress, Project};
 use smallvec::SmallVec;
 use std::{cmp::Reverse, fmt::Write, sync::Arc};
-use ui::{h_stack, Label};
+use ui::prelude::*;
 use util::ResultExt;
 use workspace::{item::ItemHandle, StatusItemView, Workspace};
 
@@ -324,7 +324,7 @@ impl Render for ActivityIndicator {
 
         result
             .children(content.icon.map(|icon| svg().path(icon)))
-            .child(Label::new(SharedString::from(content.message)))
+            .child(Label::new(SharedString::from(content.message)).size(LabelSize::Small))
     }
 }
 

crates/copilot_button2/src/copilot_button.rs πŸ”—

@@ -18,7 +18,8 @@ use workspace::{
     create_and_open_local_file,
     item::ItemHandle,
     ui::{
-        popover_menu, ButtonCommon, Clickable, ContextMenu, Icon, IconButton, PopoverMenu, Tooltip,
+        popover_menu, ButtonCommon, Clickable, ContextMenu, Icon, IconButton, IconSize,
+        PopoverMenu, Tooltip,
     },
     StatusItemView, Toast, Workspace,
 };
@@ -69,6 +70,7 @@ impl Render for CopilotButton {
         if let Status::Error(e) = status {
             return div().child(
                 IconButton::new("copilot-error", icon)
+                    .icon_size(IconSize::Small)
                     .on_click(cx.listener(move |this, _, cx| {
                         if let Some(workspace) = cx.window_handle().downcast::<Workspace>() {
                             workspace.update(cx, |workspace, cx| {

crates/diagnostics2/src/items.rs πŸ”—

@@ -25,29 +25,54 @@ impl Render for DiagnosticIndicator {
 
     fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
         let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) {
-            (0, 0) => h_stack().child(IconElement::new(Icon::Check).color(Color::Success)),
+            (0, 0) => h_stack().child(
+                IconElement::new(Icon::Check)
+                    .size(IconSize::Small)
+                    .color(Color::Success),
+            ),
             (0, warning_count) => h_stack()
                 .gap_1()
-                .child(IconElement::new(Icon::ExclamationTriangle).color(Color::Warning))
-                .child(Label::new(warning_count.to_string())),
+                .child(
+                    IconElement::new(Icon::ExclamationTriangle)
+                        .size(IconSize::Small)
+                        .color(Color::Warning),
+                )
+                .child(Label::new(warning_count.to_string()).size(LabelSize::Small)),
             (error_count, 0) => h_stack()
                 .gap_1()
-                .child(IconElement::new(Icon::XCircle).color(Color::Error))
-                .child(Label::new(error_count.to_string())),
+                .child(
+                    IconElement::new(Icon::XCircle)
+                        .size(IconSize::Small)
+                        .color(Color::Error),
+                )
+                .child(Label::new(error_count.to_string()).size(LabelSize::Small)),
             (error_count, warning_count) => h_stack()
                 .gap_1()
-                .child(IconElement::new(Icon::XCircle).color(Color::Error))
-                .child(Label::new(error_count.to_string()))
-                .child(IconElement::new(Icon::ExclamationTriangle).color(Color::Warning))
-                .child(Label::new(warning_count.to_string())),
+                .child(
+                    IconElement::new(Icon::XCircle)
+                        .size(IconSize::Small)
+                        .color(Color::Error),
+                )
+                .child(Label::new(error_count.to_string()).size(LabelSize::Small))
+                .child(
+                    IconElement::new(Icon::ExclamationTriangle)
+                        .size(IconSize::Small)
+                        .color(Color::Warning),
+                )
+                .child(Label::new(warning_count.to_string()).size(LabelSize::Small)),
         };
 
         let status = if !self.in_progress_checks.is_empty() {
-            Some(Label::new("Checking…").into_any_element())
+            Some(
+                Label::new("Checking…")
+                    .size(LabelSize::Small)
+                    .into_any_element(),
+            )
         } else if let Some(diagnostic) = &self.current_diagnostic {
             let message = diagnostic.message.split('\n').next().unwrap().to_string();
             Some(
                 Button::new("diagnostic_message", message)
+                    .label_size(LabelSize::Small)
                     .tooltip(|cx| {
                         Tooltip::for_action("Next Diagnostic", &editor::GoToDiagnostic, cx)
                     })

crates/editor2/src/items.rs πŸ”—

@@ -1200,7 +1200,7 @@ impl Render for CursorPosition {
                 write!(text, " ({} selected)", self.selected_count).unwrap();
             }
 
-            el.child(Label::new(text))
+            el.child(Label::new(text).size(LabelSize::Small))
         })
     }
 }

crates/feedback2/src/deploy_feedback_button.rs πŸ”—

@@ -31,6 +31,7 @@ impl Render for DeployFeedbackButton {
             .is_some();
         IconButton::new("give-feedback", Icon::Envelope)
             .style(ui::ButtonStyle::Subtle)
+            .icon_size(IconSize::Small)
             .selected(is_open)
             .tooltip(|cx| Tooltip::text("Share Feedback", cx))
             .on_click(|_, cx| {

crates/language_selector2/src/active_buffer_language.rs πŸ”—

@@ -3,7 +3,7 @@ use gpui::{
     div, Div, IntoElement, ParentElement, Render, Subscription, View, ViewContext, WeakView,
 };
 use std::sync::Arc;
-use ui::{Button, ButtonCommon, Clickable, Tooltip};
+use ui::{Button, ButtonCommon, Clickable, LabelSize, Tooltip};
 use workspace::{item::ItemHandle, StatusItemView, Workspace};
 
 use crate::LanguageSelector;
@@ -50,6 +50,7 @@ impl Render for ActiveBufferLanguage {
 
             el.child(
                 Button::new("change-language", active_language_text)
+                    .label_size(LabelSize::Small)
                     .on_click(cx.listener(|this, _, cx| {
                         if let Some(workspace) = this.workspace.upgrade() {
                             workspace.update(cx, |workspace, cx| {

crates/vim2/src/mode_indicator.rs πŸ”—

@@ -1,6 +1,6 @@
-use gpui::{div, AnyElement, Element, IntoElement, Render, Subscription, ViewContext};
+use gpui::{div, AnyElement, Element, Render, Subscription, ViewContext};
 use settings::SettingsStore;
-use workspace::{item::ItemHandle, ui::Label, StatusItemView};
+use workspace::{item::ItemHandle, ui::prelude::*, StatusItemView};
 
 use crate::{state::Mode, Vim};
 
@@ -61,7 +61,7 @@ impl Render for ModeIndicator {
             Mode::VisualLine => "-- VISUAL LINE --",
             Mode::VisualBlock => "-- VISUAL BLOCK --",
         };
-        Label::new(text).into_any_element()
+        Label::new(text).size(LabelSize::Small).into_any_element()
     }
 }
 

crates/workspace2/src/dock.rs πŸ”—

@@ -637,6 +637,7 @@ impl Render for PanelButtons {
                         .attach(menu_attach)
                         .trigger(
                             IconButton::new(name, icon)
+                                .icon_size(IconSize::Small)
                                 .selected(is_active_button)
                                 .on_click({
                                     let action = action.boxed_clone();