ui: Fix modifier key hints on macOS (#63807)
# Objective Fixes #63805 ## Solution change alt -> option! ## Testing I built it and saw. ## Self-Review Checklist: - [y] I've reviewed my own diff for quality, security, and reliability - [y] Unsafe blocks (if any) have justifying comments - [y] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [n] Tests cover the new/changed behavior (no behavior change) - [y] Performance impact has been considered and is acceptable ## Showcase <img width="258" height="52" alt="image" src="https://github.com/user-attachments/assets/73c215d2-dbf6-4eb7-9a96-7ef082d2be8d" /> --- Release Notes: - Fixed hints for branch and worktree deletion, keybinding conflicts, and edit predictions referring to Alt instead of Option on macOS. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
1 parent
84148a0f73
commit
08502d67ae
5 files changed
+33
-6
No files matched your search
@@ -822,7 +822,12 @@ impl EditPredictionButton {
|
||||
ContextMenuEntry::new("Subtle")
|
||||
.toggleable(IconPosition::Start, subtle_mode)
|
||||
.documentation_aside(DocumentationSide::Left, move |_| {
|
||||
Label::new("Display predictions inline only when holding a modifier key (alt by default).").into_any_element()
|
||||
Label::new(concat!(
|
||||
"Display predictions inline only when holding a modifier key (",
|
||||
ui::alt_key_name!(),
|
||||
" by default)."
|
||||
))
|
||||
.into_any_element()
|
||||
})
|
||||
.handler({
|
||||
let fs = fs.clone();
|
||||
|
||||
@@ -883,7 +883,7 @@ impl Render for DeleteBranchTooltip {
|
||||
Tooltip::with_meta_in(
|
||||
"Delete Branch",
|
||||
Some(&branch_picker::DeleteBranch),
|
||||
"Hold alt to force delete",
|
||||
concat!("Hold ", ui::alt_key_name!(), " to force delete"),
|
||||
&self.focus_handle,
|
||||
cx,
|
||||
)
|
||||
|
||||
@@ -413,7 +413,7 @@ impl Render for DeleteWorktreeTooltip {
|
||||
Tooltip::with_meta_in(
|
||||
"Delete Worktree",
|
||||
Some(&DeleteWorktree),
|
||||
"Hold alt to force delete",
|
||||
concat!("Hold ", ui::alt_key_name!(), " to force delete"),
|
||||
&self.focus_handle,
|
||||
cx,
|
||||
)
|
||||
|
||||
@@ -1163,7 +1163,7 @@ impl KeymapEditor {
|
||||
Tooltip::with_meta(
|
||||
"View conflicts",
|
||||
Some(&ToggleConflictFilter),
|
||||
"Use alt+click to show all conflicts",
|
||||
concat!("Use ", ui::alt_key_name!(), "+click to show all conflicts"),
|
||||
cx,
|
||||
)
|
||||
})
|
||||
@@ -1193,11 +1193,15 @@ impl KeymapEditor {
|
||||
}))
|
||||
} else {
|
||||
base_button_style(index, IconName::Info)
|
||||
.tooltip(|_window, cx| {
|
||||
.tooltip(|_window, cx| {
|
||||
Tooltip::with_meta(
|
||||
"Show matching keybinds",
|
||||
Some(&ShowMatchingKeybinds),
|
||||
"This binding is overridden by other bindings.\nUse alt+click to edit this binding",
|
||||
concat!(
|
||||
"This binding is overridden by other bindings.\nUse ",
|
||||
ui::alt_key_name!(),
|
||||
"+click to edit this binding"
|
||||
),
|
||||
cx,
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/// Expands to a literal so platform-specific hints can use `concat!` without allocating.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[macro_export]
|
||||
macro_rules! alt_key_name {
|
||||
() => {
|
||||
"option"
|
||||
};
|
||||
}
|
||||
|
||||
/// Expands to a literal so platform-specific hints can use `concat!` without allocating.
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
#[macro_export]
|
||||
macro_rules! alt_key_name {
|
||||
() => {
|
||||
"alt"
|
||||
};
|
||||
}
|
||||
|
||||
/// The platform style to use when rendering UI.
|
||||
///
|
||||
/// This can be used to abstract over platform differences.
|
||||
|
||||
Reference in new issue
Block a user