|
|
|
@ -51,6 +51,14 @@ palette = config \
|
|
|
|
| True \ y + h - listHeight
|
|
|
|
| True \ y + h - listHeight
|
|
|
|
| False \ offset));
|
|
|
|
| False \ offset));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onSelect = text \
|
|
|
|
|
|
|
|
batch [
|
|
|
|
|
|
|
|
paletteState.query := "",
|
|
|
|
|
|
|
|
paletteState.focusedIndex := 0,
|
|
|
|
|
|
|
|
paletteState.scrollOffset := 0,
|
|
|
|
|
|
|
|
config.onSelect text,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
paletteRow = config \
|
|
|
|
paletteRow = config \
|
|
|
|
color = (config.selected | True \ "rgba(255,255,255,0.2)" | False \ "transparent");
|
|
|
|
color = (config.selected | True \ "rgba(255,255,255,0.2)" | False \ "transparent");
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,8 +93,8 @@ palette = config \
|
|
|
|
newIndex = nextSelectable results effectiveIndex 1;
|
|
|
|
newIndex = nextSelectable results effectiveIndex 1;
|
|
|
|
{ state = state, emit = [paletteState.focusedIndex := newIndex, paletteState.scrollOffset := scrollTo newIndex] })
|
|
|
|
{ state = state, emit = [paletteState.focusedIndex := newIndex, paletteState.scrollOffset := scrollTo newIndex] })
|
|
|
|
| Key { key = "Enter" } \
|
|
|
|
| Key { key = "Enter" } \
|
|
|
|
(nth paletteState.focusedIndex results
|
|
|
|
(nth effectiveIndex results
|
|
|
|
| Some (Item data) \ { state = state, emit = [paletteState.focusedIndex := 0, config.onSelect data.label] }
|
|
|
|
| Some (Item data) \ { state = state, emit = [onSelect data.label] }
|
|
|
|
| _ \ { state = state, emit = [] })
|
|
|
|
| _ \ { state = state, emit = [] })
|
|
|
|
| _ \ { state = state, emit = [] },
|
|
|
|
| _ \ { state = state, emit = [] },
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +146,7 @@ palette = config \
|
|
|
|
w = contentWidth,
|
|
|
|
w = contentWidth,
|
|
|
|
h = textInputHeight,
|
|
|
|
h = textInputHeight,
|
|
|
|
selected = (effectiveIndex == i),
|
|
|
|
selected = (effectiveIndex == i),
|
|
|
|
onClick = _ \ config.onSelect data.label
|
|
|
|
onClick = _ \ onSelect data.label
|
|
|
|
}
|
|
|
|
}
|
|
|
|
| _ \ empty
|
|
|
|
| _ \ empty
|
|
|
|
) results)
|
|
|
|
) results)
|
|
|
|
|