Update command_palette.rs
This commit is contained in:
parent
a9cb6589dd
commit
40bbbd3226
1 changed files with 18 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
use collections::{CommandPaletteFilter, HashMap};
|
use collections::{CommandPaletteFilter, HashMap};
|
||||||
use fuzzy::{StringMatch, StringMatchCandidate};
|
use fuzzy::{StringMatch, StringMatchCandidate};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, Action, AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView,
|
actions, rems, Action, AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView,
|
||||||
Keystroke, ParentElement, Render, Styled, View, ViewContext, VisualContext, WeakView,
|
Keystroke, ParentElement, Render, Styled, View, ViewContext, VisualContext, WeakView,
|
||||||
};
|
};
|
||||||
use picker::{Picker, PickerDelegate};
|
use picker::{Picker, PickerDelegate};
|
||||||
|
@ -79,7 +79,10 @@ impl Render for CommandPalette {
|
||||||
type Element = Div;
|
type Element = Div;
|
||||||
|
|
||||||
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {
|
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {
|
||||||
v_stack().w_96().child(self.picker.clone())
|
v_stack()
|
||||||
|
.min_w_96()
|
||||||
|
.max_w(rems(36.))
|
||||||
|
.child(self.picker.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,8 +304,12 @@ impl PickerDelegate for CommandPaletteDelegate {
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(
|
Some(
|
||||||
ListItem::new(ix).selected(selected).child(
|
ListItem::new(ix)
|
||||||
|
.variant(ui::ListItemVariant::Inset)
|
||||||
|
.selected(selected)
|
||||||
|
.child(
|
||||||
h_stack()
|
h_stack()
|
||||||
|
.w_full()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.child(HighlightedLabel::new(
|
.child(HighlightedLabel::new(
|
||||||
command.name.clone(),
|
command.name.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue