diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index b4a077b1e82f4b5ca4367180195dbe733c87d249..0a423f7e54774deff297fa0e44d9ecc7b0c49f34 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -51,7 +51,8 @@ use theme::SyntaxTheme; use theme_settings::ThemeSettings; use ui::{ ContextMenu, FluentBuilder, HighlightedLabel, IconButton, IconButtonShape, IndentGuideColors, - IndentGuideLayout, ListItem, ScrollAxes, Scrollbars, Tab, Tooltip, WithScrollbar, prelude::*, + IndentGuideLayout, KeyBinding, ListItem, ScrollAxes, Scrollbars, Tab, Tooltip, WithScrollbar, + prelude::*, }; use util::{RangeExt, ResultExt, TryFutureExt, debug_panic, rel_path::RelPath}; use workspace::{ @@ -4561,18 +4562,30 @@ impl OutlinePanel { .child(Label::new(query)), ) }) - .child(h_flex().justify_center().child({ - let keystroke = match self.position(window, cx) { - DockPosition::Left => window.keystroke_text_for(&workspace::ToggleLeftDock), - DockPosition::Bottom => { - window.keystroke_text_for(&workspace::ToggleBottomDock) - } - DockPosition::Right => { - window.keystroke_text_for(&workspace::ToggleRightDock) - } - }; - Label::new(format!("Toggle Panel With {keystroke}")).color(Color::Muted) - })) + .child( + h_flex() + .gap_1() + .justify_center() + .child(Label::new("Toggle Panel With").color(Color::Muted)) + .child({ + let key_binding = match self.position(window, cx) { + DockPosition::Left => { + KeyBinding::for_action(&workspace::ToggleLeftDock, cx) + .into_any_element() + } + DockPosition::Bottom => { + KeyBinding::for_action(&workspace::ToggleBottomDock, cx) + .into_any_element() + } + DockPosition::Right => { + KeyBinding::for_action(&workspace::ToggleRightDock, cx) + .into_any_element() + } + }; + + key_binding + }), + ) } else { let list_contents = { let items_len = self.cached_entries.len();