fixing some bugs

master
Dustin Swan 2 weeks ago
parent 80cd8d6c7b
commit 5fc9d13f80
Signed by: dustinswan
GPG Key ID: 30D46587E2100467

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

@ -27,7 +27,7 @@ openWindow = title content \
fullWidth = False
}],
osState.palette.visible := False,
focusWindow id
focusWindow (len osState.windows)
];
closeWindowByIndex = i \

Loading…
Cancel
Save