Fix toolbar spacing regressions (#29964)

Cleaning up as I introduced a few regressions in this PR:
https://github.com/zed-industries/zed/pull/29866.

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-05-05 22:28:35 -03:00 committed by GitHub
parent bdd911f89e
commit 377909a646
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 33 deletions

View file

@ -26,7 +26,7 @@ use std::{
ops::Range, ops::Range,
sync::Arc, sync::Arc,
}; };
use ui::{Divider, IconButtonShape, KeyBinding, Tooltip, prelude::*, vertical_divider}; use ui::{IconButtonShape, KeyBinding, Tooltip, prelude::*, vertical_divider};
use util::ResultExt; use util::ResultExt;
use workspace::{ use workspace::{
Item, ItemHandle, ItemNavHistory, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Item, ItemHandle, ItemNavHistory, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView,
@ -1035,8 +1035,8 @@ impl Render for AgentDiffToolbar {
} }
}), }),
) )
.into_any(), .into_any_element(),
Divider::vertical().into_any_element(), vertical_divider().into_any_element(),
h_flex() h_flex()
.gap_0p5() .gap_0p5()
.child( .child(
@ -1069,37 +1069,34 @@ impl Render for AgentDiffToolbar {
this.dispatch_action(&KeepAll, window, cx) this.dispatch_action(&KeepAll, window, cx)
})), })),
) )
.into_any(), .into_any_element(),
Divider::vertical().into_any_element(),
], ],
}; };
h_flex() h_flex()
.track_focus(&editor_focus_handle) .track_focus(&editor_focus_handle)
.size_full() .size_full()
.child( .px_1()
h_flex() .mr_1()
.py(DynamicSpacing::Base08.rems(cx)) .gap_1()
.px_2() .children(content)
.gap_1() .child(vertical_divider())
.children(content) .when_some(editor.read(cx).workspace(), |this, _workspace| {
.when_some(editor.read(cx).workspace(), |this, _workspace| { this.child(
this.child( IconButton::new("review", IconName::ListCollapse)
IconButton::new("review", IconName::ListCollapse) .icon_size(IconSize::Small)
.icon_size(IconSize::Small) .tooltip(Tooltip::for_action_title_in(
.tooltip(Tooltip::for_action_title_in( "Review All Files",
"Review All Files", &OpenAgentDiff,
&OpenAgentDiff, &editor_focus_handle,
&editor_focus_handle, ))
)) .on_click({
.on_click({ cx.listener(move |this, _, window, cx| {
cx.listener(move |this, _, window, cx| { this.dispatch_action(&OpenAgentDiff, window, cx);
this.dispatch_action(&OpenAgentDiff, window, cx); })
}) }),
}), )
) })
}),
)
.child(vertical_divider()) .child(vertical_divider())
.on_action({ .on_action({
let editor = editor.clone(); let editor = editor.clone();
@ -1129,7 +1126,8 @@ impl Render for AgentDiffToolbar {
let focus_handle = agent_diff.focus_handle(cx); let focus_handle = agent_diff.focus_handle(cx);
h_group_xl() h_group_xl()
.px_2() .my_neg_1()
.py_1()
.items_center() .items_center()
.flex_wrap() .flex_wrap()
.child( .child(

View file

@ -893,9 +893,8 @@ impl Render for ProjectDiffToolbar {
h_group_xl() h_group_xl()
.my_neg_1() .my_neg_1()
.items_center()
.py_1() .py_1()
.px_2() .items_center()
.flex_wrap() .flex_wrap()
.justify_between() .justify_between()
.child( .child(

View file

@ -106,6 +106,7 @@ impl Render for Toolbar {
v_flex() v_flex()
.group("toolbar") .group("toolbar")
.relative() .relative()
.p(DynamicSpacing::Base08.rems(cx))
.when(has_left_items || has_right_items, |this| { .when(has_left_items || has_right_items, |this| {
this.gap(DynamicSpacing::Base08.rems(cx)) this.gap(DynamicSpacing::Base08.rems(cx))
}) })
@ -121,7 +122,6 @@ impl Render for Toolbar {
.when(has_left_items, |this| { .when(has_left_items, |this| {
this.child( this.child(
h_flex() h_flex()
.p(DynamicSpacing::Base08.rems(cx))
.flex_auto() .flex_auto()
.justify_start() .justify_start()
.overflow_x_hidden() .overflow_x_hidden()

View file

@ -433,7 +433,6 @@ impl Render for QuickActionBar {
h_flex() h_flex()
.id("quick action bar") .id("quick action bar")
.p(DynamicSpacing::Base08.rems(cx))
.gap(DynamicSpacing::Base01.rems(cx)) .gap(DynamicSpacing::Base01.rems(cx))
.children(self.render_repl_menu(cx)) .children(self.render_repl_menu(cx))
.children(self.render_toggle_markdown_preview(self.workspace.clone(), cx)) .children(self.render_toggle_markdown_preview(self.workspace.clone(), cx))