Convert keymap context to use generics and Cow<'static> so we don't have to add .to_string() and .into() for each usage
This commit is contained in:
parent
ffe53bed87
commit
9004640586
13 changed files with 97 additions and 93 deletions
|
@ -21,6 +21,7 @@ use gpui::{
|
|||
vector::{vec2f, Vector2F},
|
||||
},
|
||||
impl_actions, impl_internal_actions,
|
||||
keymap_matcher::KeymapContext,
|
||||
platform::{CursorStyle, NavigationDirection},
|
||||
Action, AnyViewHandle, AnyWeakViewHandle, AppContext, AsyncAppContext, Entity, EventContext,
|
||||
ModelHandle, MouseButton, MutableAppContext, PromptLevel, Quad, RenderContext, Task, View,
|
||||
|
@ -1550,6 +1551,14 @@ impl View for Pane {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn keymap_context(&self, _: &AppContext) -> KeymapContext {
|
||||
let mut keymap = Self::default_keymap_context();
|
||||
if self.docked.is_some() {
|
||||
keymap.add_identifier("docked");
|
||||
}
|
||||
keymap
|
||||
}
|
||||
}
|
||||
|
||||
fn tab_bar_button<A: Action>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue