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.

Use square buttons for code action and run indicators in the gutter (#12906)

versecafe0d43d484f68a
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index fbd8863c6b6..62f7eaa8782 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -4915,8 +4915,8 @@ impl Editor {
if self.available_code_actions.is_some() {
Some(
IconButton::new("code_actions_indicator", ui::IconName::Bolt)
+ .shape(ui::IconButtonShape::Square)
.icon_size(IconSize::XSmall)
- .size(ui::ButtonSize::None)
.icon_color(Color::Muted)
.selected(is_active)
.on_click(cx.listener(move |editor, _e, cx| {
@@ -4953,8 +4953,8 @@ impl Editor {
cx: &mut ViewContext<Self>,
) -> IconButton {
IconButton::new(("run_indicator", row.0 as usize), ui::IconName::Play)
+ .shape(ui::IconButtonShape::Square)
.icon_size(IconSize::XSmall)
- .size(ui::ButtonSize::None)
.icon_color(Color::Muted)
.selected(is_active)
.on_click(cx.listener(move |editor, _e, cx| {
diff --git a/crates/ui/src/components/button/icon_button.rs b/crates/ui/src/components/button/icon_button.rs
index 3973ebe8c63..9edc23ac2d2 100644
--- a/crates/ui/src/components/button/icon_button.rs
+++ b/crates/ui/src/components/button/icon_button.rs
@@ -145,7 +145,7 @@ impl RenderOnce for IconButton {
let icon_size = self.icon_size.rems() * cx.rem_size();
let padding = match self.icon_size {
IconSize::Indicator => Spacing::None.px(cx),
- IconSize::XSmall => Spacing::None.px(cx),
+ IconSize::XSmall => Spacing::XSmall.px(cx),
IconSize::Small => Spacing::XSmall.px(cx),
IconSize::Medium => Spacing::XSmall.px(cx),
};