padding. esc to close palette

This commit is contained in:
Dustin Swan 2026-02-18 16:27:28 -07:00
parent 91e9ccd92e
commit 6ca485bf1d
No known key found for this signature in database
GPG key ID: 30D46587E2100467
2 changed files with 13 additions and 9 deletions

View file

@ -97,6 +97,7 @@ palette = config \
(nth effectiveIndex results
| Some (Item data) \ { state = state, emit = [onSelect data.label] }
| _ \ { state = state, emit = [] })
| Key { key = "Escape" } \ { state = state, emit = [osState.palette.visible := False] }
| _ \ { state = state, emit = [] },
view = state emit \

View file

@ -211,14 +211,17 @@ tree = config \
paths = visiblePaths config.value config.path state.expanded;
selectedPath = (nth state.selectedIndex paths) | Some item \ Some item.path | None \ None;
scrollable {
w = config.w,
h = config.h,
totalWidth = config.w,
totalHeight = totalH,
scrollX = 0,
scrollY = state.scrollY,
onScroll = delta \ emit (Scrolled delta),
child = treeNode { value = config.value, path = config.path, depth = 0, expanded = state.expanded, onToggle = onToggle, selectedPath = selectedPath, prefix = "", editing = state.editing, onDoneEditing = onDoneEditing, onEditLeaf = onEditLeaf }
ui.padding {
amount = 8,
child = scrollable {
w = config.w,
h = config.h,
totalWidth = config.w,
totalHeight = totalH,
scrollX = 0,
scrollY = state.scrollY,
onScroll = delta \ emit (Scrolled delta),
child = treeNode { value = config.value, path = config.path, depth = 0, expanded = state.expanded, onToggle = onToggle, selectedPath = selectedPath, prefix = "", editing = state.editing, onDoneEditing = onDoneEditing, onEditLeaf = onEditLeaf }
}
}
};