Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make close tab and pin tab buttons slightly larger for better usability (#34428)

Daniel Sauble91474e247f18
diff --git a/crates/ui/src/components/tab.rs b/crates/ui/src/components/tab.rs
index d704846a683..e6823f46b75 100644
--- a/crates/ui/src/components/tab.rs
+++ b/crates/ui/src/components/tab.rs
@@ -5,6 +5,9 @@ use smallvec::SmallVec;
use crate::prelude::*;
+const START_TAB_SLOT_SIZE: Pixels = px(12.);
+const END_TAB_SLOT_SIZE: Pixels = px(14.);
+
/// The position of a [`Tab`] within a list of tabs.
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum TabPosition {
@@ -123,12 +126,12 @@ impl RenderOnce for Tab {
let (start_slot, end_slot) = {
let start_slot = h_flex()
- .size(px(12.)) // use px over rem from size_3
+ .size(START_TAB_SLOT_SIZE)
.justify_center()
.children(self.start_slot);
let end_slot = h_flex()
- .size(px(12.)) // use px over rem from size_3
+ .size(END_TAB_SLOT_SIZE)
.justify_center()
.children(self.end_slot);
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index a9e7304e47d..0c35752165b 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -2519,7 +2519,7 @@ impl Pane {
.shape(IconButtonShape::Square)
.icon_color(Color::Muted)
.size(ButtonSize::None)
- .icon_size(IconSize::XSmall)
+ .icon_size(IconSize::Small)
.on_click(cx.listener(move |pane, _, window, cx| {
pane.unpin_tab_at(ix, window, cx);
}))
@@ -2539,7 +2539,7 @@ impl Pane {
.shape(IconButtonShape::Square)
.icon_color(Color::Muted)
.size(ButtonSize::None)
- .icon_size(IconSize::XSmall)
+ .icon_size(IconSize::Small)
.on_click(cx.listener(move |pane, _, window, cx| {
pane.close_item_by_id(item_id, SaveIntent::Close, window, cx)
.detach_and_log_err(cx);