Fix context in command palette from application menu (#14599)
Supercedes #14468 Release Notes: - linux: Fixed the command palette when opened from the application menu
This commit is contained in:
parent
448ef538b3
commit
1fe16f42ea
1 changed files with 2 additions and 1 deletions
|
@ -13,9 +13,10 @@ impl RenderOnce for ApplicationMenu {
|
||||||
fn render(self, _cx: &mut WindowContext) -> impl IntoElement {
|
fn render(self, _cx: &mut WindowContext) -> impl IntoElement {
|
||||||
PopoverMenu::new("application-menu")
|
PopoverMenu::new("application-menu")
|
||||||
.menu(move |cx| {
|
.menu(move |cx| {
|
||||||
ContextMenu::build(cx, move |menu, _cx| {
|
ContextMenu::build(cx, move |menu, cx| {
|
||||||
menu.header("Workspace")
|
menu.header("Workspace")
|
||||||
.action("Open Command Palette", Box::new(command_palette::Toggle))
|
.action("Open Command Palette", Box::new(command_palette::Toggle))
|
||||||
|
.when_some(cx.focused(), |menu, focused| menu.context(focused))
|
||||||
.custom_row(move |cx| {
|
.custom_row(move |cx| {
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue