Give hover state to picker items, keystrokes in command palette

This commit is contained in:
Max Brunsfeld 2022-04-28 15:17:56 -07:00
parent a60c75e343
commit 8481834847
20 changed files with 269 additions and 288 deletions

View file

@ -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())