we have mouse scrolling

master
Dustin Swan 2 weeks ago
parent 164f752338
commit 783146dabc
Signed by: dustinswan
GPG Key ID: 30D46587E2100467

@ -16,6 +16,7 @@ palette = config \
dialogPadding = 0;
itemGap = 1;
textInputHeight = 40;
sectionHeight = 30;
contentWidth = windowWidth - (dialogPadding * 2);
@ -34,8 +35,12 @@ palette = config \
| Item _ \ textInputHeight
| _ \ 0;
totalHeight = (sum (map itemHeight results)) + itemGap * (len results - 1);
itemY = i \ (sum (map itemHeight (take i results))) + i;
onScroll = delta \ paletteState.scrollOffset := max 0 (min (totalHeight - listHeight) (paletteState.scrollOffset + delta.deltaY));
scrollTo = index \
y = itemY index;
h = unwrapOr 0 (nth index (map itemHeight results));
@ -114,9 +119,9 @@ palette = config \
h = listHeight,
scrollX = 0,
scrollY = paletteState.scrollOffset,
onScroll = _ \ noOp,
onScroll = onScroll,
child = ui.column {
gap = 1,
gap = itemGap,
children = [
...(mapWithIndex (entry i \ entry
| Section title \ box {

Loading…
Cancel
Save