Give hover state to picker items, keystrokes in command palette
This commit is contained in:
parent
a60c75e343
commit
8481834847
20 changed files with 269 additions and 288 deletions
|
@ -203,15 +203,17 @@ impl PickerDelegate for ThemeSelector {
|
|||
})
|
||||
}
|
||||
|
||||
fn render_match(&self, ix: usize, selected: bool, cx: &AppContext) -> ElementBox {
|
||||
fn render_match(
|
||||
&self,
|
||||
ix: usize,
|
||||
mouse_state: &MouseState,
|
||||
selected: bool,
|
||||
cx: &AppContext,
|
||||
) -> ElementBox {
|
||||
let settings = cx.global::<Settings>();
|
||||
let theme = &settings.theme;
|
||||
let theme_match = &self.matches[ix];
|
||||
let style = if selected {
|
||||
&theme.picker.active_item
|
||||
} else {
|
||||
&theme.picker.item
|
||||
};
|
||||
let style = theme.picker.item.style_for(mouse_state, selected);
|
||||
|
||||
Label::new(theme_match.string.clone(), style.label.clone())
|
||||
.with_highlights(theme_match.positions.clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue