Add key contexts for Pickers (#35665)
Closes: https://github.com/zed-industries/zed/issues/35430 Added: - Workspace > CommandPalette - Workspace > GitBranchSelector - Workspace > GitRepositorySelector - Workspace > RecentProjects - Workspace > LanguageSelector - Workspace > IconThemeSelector - Workspace > ThemeSelector Release Notes: - Added new keymap contexts for various Pickers - CommandPalette, GitBranchSelector, GitRepositorySelector, RecentProjects, LanguageSelector, IconThemeSelector, ThemeSelector
This commit is contained in:
parent
a80da784b7
commit
f9038f6189
7 changed files with 22 additions and 5 deletions
|
@ -136,7 +136,10 @@ impl Focusable for CommandPalette {
|
|||
|
||||
impl Render for CommandPalette {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex().w(rems(34.)).child(self.picker.clone())
|
||||
v_flex()
|
||||
.key_context("CommandPalette")
|
||||
.w(rems(34.))
|
||||
.child(self.picker.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -180,6 +180,7 @@ impl Focusable for BranchList {
|
|||
impl Render for BranchList {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex()
|
||||
.key_context("GitBranchSelector")
|
||||
.w(self.width)
|
||||
.on_modifiers_changed(cx.listener(Self::handle_modifiers_changed))
|
||||
.child(self.picker.clone())
|
||||
|
|
|
@ -109,7 +109,10 @@ impl Focusable for RepositorySelector {
|
|||
|
||||
impl Render for RepositorySelector {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
div().w(self.width).child(self.picker.clone())
|
||||
div()
|
||||
.key_context("GitRepositorySelector")
|
||||
.w(self.width)
|
||||
.child(self.picker.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,10 @@ impl LanguageSelector {
|
|||
|
||||
impl Render for LanguageSelector {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex().w(rems(34.)).child(self.picker.clone())
|
||||
v_flex()
|
||||
.key_context("LanguageSelector")
|
||||
.w(rems(34.))
|
||||
.child(self.picker.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,7 @@ impl Focusable for RecentProjects {
|
|||
impl Render for RecentProjects {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex()
|
||||
.key_context("RecentProjects")
|
||||
.w(rems(self.rem_width))
|
||||
.child(self.picker.clone())
|
||||
.on_mouse_down_out(cx.listener(|this, _, window, cx| {
|
||||
|
|
|
@ -40,7 +40,10 @@ impl IconThemeSelector {
|
|||
|
||||
impl Render for IconThemeSelector {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex().w(rems(34.)).child(self.picker.clone())
|
||||
v_flex()
|
||||
.key_context("IconThemeSelector")
|
||||
.w(rems(34.))
|
||||
.child(self.picker.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,10 @@ impl Focusable for ThemeSelector {
|
|||
|
||||
impl Render for ThemeSelector {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex().w(rems(34.)).child(self.picker.clone())
|
||||
v_flex()
|
||||
.key_context("ThemeSelector")
|
||||
.w(rems(34.))
|
||||
.child(self.picker.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue