Reorganize Quick Action Bar (#13476)

This PR:

- Moves the selection menu to the end with the editor settings menu
- Tidies up labels in the settings menu
- Minor spacing updates

Release Notes:

- Improved organization in the Quick Action Bar
This commit is contained in:
Nate Butler 2024-06-24 15:34:22 -04:00 committed by GitHub
parent 8949460bd7
commit ed94bd41eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -210,7 +210,7 @@ impl Render for QuickActionBar {
let menu = ContextMenu::build(cx, |mut menu, _| { let menu = ContextMenu::build(cx, |mut menu, _| {
if supports_inlay_hints { if supports_inlay_hints {
menu = menu.toggleable_entry( menu = menu.toggleable_entry(
"Show Inlay Hints", "Inlay Hints",
inlay_hints_enabled, inlay_hints_enabled,
Some(editor::actions::ToggleInlayHints.boxed_clone()), Some(editor::actions::ToggleInlayHints.boxed_clone()),
{ {
@ -228,7 +228,7 @@ impl Render for QuickActionBar {
} }
menu = menu.toggleable_entry( menu = menu.toggleable_entry(
"Show Git Blame Inline", "Inline Git Blame",
git_blame_inline_enabled, git_blame_inline_enabled,
Some(editor::actions::ToggleGitBlameInline.boxed_clone()), Some(editor::actions::ToggleGitBlameInline.boxed_clone()),
{ {
@ -245,7 +245,7 @@ impl Render for QuickActionBar {
); );
menu = menu.toggleable_entry( menu = menu.toggleable_entry(
"Show Selection Menu", "Selection Menu",
selection_menu_enabled, selection_menu_enabled,
Some(editor::actions::ToggleSelectionMenu.boxed_clone()), Some(editor::actions::ToggleSelectionMenu.boxed_clone()),
{ {
@ -276,19 +276,23 @@ impl Render for QuickActionBar {
h_flex() h_flex()
.id("quick action bar") .id("quick action bar")
.gap_3() .gap(Spacing::XLarge.rems(cx))
.child( .child(
h_flex() h_flex()
.gap_1p5() .gap(Spacing::Medium.rems(cx))
.children(search_button) .children(search_button)
.children(editor_selections_dropdown)
.when( .when(
AssistantSettings::get_global(cx).enabled AssistantSettings::get_global(cx).enabled
&& AssistantSettings::get_global(cx).button, && AssistantSettings::get_global(cx).button,
|bar| bar.child(assistant_button), |bar| bar.child(assistant_button),
), ),
) )
.child(editor_settings_dropdown) .child(
h_flex()
.gap(Spacing::Medium.rems(cx))
.children(editor_selections_dropdown)
.child(editor_settings_dropdown),
)
.when_some( .when_some(
self.toggle_settings_menu.as_ref(), self.toggle_settings_menu.as_ref(),
|el, toggle_settings_menu| { |el, toggle_settings_menu| {