Properly display keybindings in context menus
This commit is contained in:
parent
6f1dcb4e94
commit
a5e63fbf77
2 changed files with 8 additions and 13 deletions
|
@ -20,7 +20,7 @@ use live_kit_client::{
|
||||||
};
|
};
|
||||||
use postage::stream::Stream;
|
use postage::stream::Stream;
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use std::{future::Future, mem, panic::Location, pin::Pin, sync::Arc, time::Duration};
|
use std::{future::Future, mem, pin::Pin, sync::Arc, time::Duration};
|
||||||
use util::{post_inc, ResultExt, TryFutureExt};
|
use util::{post_inc, ResultExt, TryFutureExt};
|
||||||
|
|
||||||
pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
|
pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
|
||||||
|
@ -1089,7 +1089,6 @@ impl Room {
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn share_microphone(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
pub fn share_microphone(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||||
dbg!(Location::caller());
|
|
||||||
if self.status.is_offline() {
|
if self.status.is_offline() {
|
||||||
return Task::ready(Err(anyhow!("room is offline")));
|
return Task::ready(Err(anyhow!("room is offline")));
|
||||||
} else if self.is_sharing_mic() {
|
} else if self.is_sharing_mic() {
|
||||||
|
|
|
@ -3411,18 +3411,14 @@ impl<'a, 'b, 'c, V: View> LayoutContext<'a, 'b, 'c, V> {
|
||||||
handler_depth = Some(contexts.len())
|
handler_depth = Some(contexts.len())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let action_contexts = if let Some(depth) = handler_depth {
|
||||||
|
&contexts[depth..]
|
||||||
|
} else {
|
||||||
|
&contexts
|
||||||
|
};
|
||||||
|
|
||||||
self.keystroke_matcher
|
self.keystroke_matcher
|
||||||
.bindings_for_action(action.id())
|
.keystrokes_for_action(action, action_contexts)
|
||||||
.find_map(|b| {
|
|
||||||
let highest_handler = handler_depth?;
|
|
||||||
if action.eq(b.action())
|
|
||||||
&& (0..=highest_handler).any(|depth| b.match_context(&contexts[depth..]))
|
|
||||||
{
|
|
||||||
Some(b.keystrokes().into())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn notify_if_view_ancestors_change(&mut self, view_id: usize) {
|
fn notify_if_view_ancestors_change(&mut self, view_id: usize) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue