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.

recent_projects: Fix unaligned keybinding labels in quick-switch menu (#54325)

galuis116f37df7b78d01
diff --git a/crates/recent_projects/src/sidebar_recent_projects.rs b/crates/recent_projects/src/sidebar_recent_projects.rs
index 65ed83831a8..7c50e5ca395 100644
--- a/crates/recent_projects/src/sidebar_recent_projects.rs
+++ b/crates/recent_projects/src/sidebar_recent_projects.rs
@@ -12,7 +12,7 @@ use picker::{
};
use remote::RemoteConnectionOptions;
use settings::Settings;
-use ui::{KeyBinding, ListItem, ListItemSpacing, Tooltip, prelude::*};
+use ui::{ButtonLike, KeyBinding, ListItem, ListItemSpacing, Tooltip, prelude::*};
use ui_input::ErasedEditor;
use util::{ResultExt, paths::PathExt};
use workspace::{
@@ -417,22 +417,36 @@ impl PickerDelegate for SidebarRecentProjectsDelegate {
create_new_window: false,
};
- Button::new("open_local_folder", "Add Local Folders")
- .key_binding(KeyBinding::for_action_in(&open_action, &focus_handle, cx))
+ ButtonLike::new("open_local_folder")
+ .child(
+ h_flex()
+ .w_full()
+ .gap_1()
+ .justify_between()
+ .child(Label::new("Add Local Folders"))
+ .child(KeyBinding::for_action_in(&open_action, &focus_handle, cx)),
+ )
.on_click(cx.listener(move |_, _, window, cx| {
window.dispatch_action(open_action.boxed_clone(), cx);
cx.emit(DismissEvent);
}))
})
.child(
- Button::new("open_remote_folder", "Add Remote Folder")
- .key_binding(KeyBinding::for_action(
- &OpenRemote {
- from_existing_connection: false,
- create_new_window: false,
- },
- cx,
- ))
+ ButtonLike::new("open_remote_folder")
+ .child(
+ h_flex()
+ .w_full()
+ .gap_1()
+ .justify_between()
+ .child(Label::new("Add Remote Folder"))
+ .child(KeyBinding::for_action(
+ &OpenRemote {
+ from_existing_connection: false,
+ create_new_window: false,
+ },
+ cx,
+ )),
+ )
.on_click(cx.listener(|_, _, window, cx| {
window.dispatch_action(
OpenRemote {