padding. esc to close palette

master
Dustin Swan 1 week ago
parent 91e9ccd92e
commit 6ca485bf1d
Signed by: dustinswan
GPG Key ID: 30D46587E2100467

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

@ -211,14 +211,17 @@ tree = config \
paths = visiblePaths config.value config.path state.expanded; paths = visiblePaths config.value config.path state.expanded;
selectedPath = (nth state.selectedIndex paths) | Some item \ Some item.path | None \ None; selectedPath = (nth state.selectedIndex paths) | Some item \ Some item.path | None \ None;
scrollable { ui.padding {
w = config.w, amount = 8,
h = config.h, child = scrollable {
totalWidth = config.w, w = config.w,
totalHeight = totalH, h = config.h,
scrollX = 0, totalWidth = config.w,
scrollY = state.scrollY, totalHeight = totalH,
onScroll = delta \ emit (Scrolled delta), scrollX = 0,
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 } 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 }
}
} }
}; };

Loading…
Cancel
Save