@@ -4,6 +4,7 @@ use gpui::{
};
use itertools::Itertools;
use serde_json::json;
+use settings::get_key_equivalents;
use ui::{
div, h_flex, px, v_flex, ButtonCommon, Clickable, FluentBuilder, InteractiveElement, Label,
LabelCommon, LabelSize, ParentElement, SharedString, StatefulInteractiveElement, Styled,
@@ -167,6 +168,7 @@ impl Item for KeyContextView {
impl Render for KeyContextView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl ui::IntoElement {
use itertools::Itertools;
+ let key_equivalents = get_key_equivalents(cx.keyboard_layout());
v_flex()
.id("key-context-view")
.overflow_scroll()
@@ -276,5 +278,17 @@ impl Render for KeyContextView {
}),
)
})
+ .when_some(key_equivalents, |el, key_equivalents| {
+ el.child(Label::new("Key Equivalents").mt_4().size(LabelSize::Large))
+ .child(Label::new("Shortcuts defined using some characters have been remapped so that shortcuts can be typed without holding option."))
+ .children(
+ key_equivalents
+ .iter()
+ .sorted()
+ .map(|(key, equivalent)| {
+ Label::new(format!("cmd-{} => cmd-{}", key, equivalent)).ml_8()
+ }),
+ )
+ })
}
}