vaxis

created pr with 51.1 on 2025-03-12T17:28:45Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 51 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 51.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 51

Patchset 51.1 on 2025-03-12T17:28:45Z · commit 394e1cf

+1 -0 _examples/vxfw/list/main.go #
......@@ -79,6 +79,7 @@ func main() {
7979 list: list.Dynamic{
8080 Builder: getWidget,
8181 DrawCursor: true,
82+ Gap: 1,
8283 },
8384 }
8485
+5 -2 vxfw/list/list.go #
......@@ -23,6 +23,9 @@ type Dynamic struct {
2323 // events. Set this to true to use custom event handlers
2424 DisableEventHandlers bool
2525
26+ // Distance between each list item
27+ Gap int
28+
2629 cursor uint
2730 scroll scroll
2831 }
......@@ -180,7 +183,7 @@ func (d *Dynamic) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
180183 s.AddChild(colOffset, ah, chS)
181184
182185 // Add our height to accumulated height
183- ah += int(chS.Size.Height)
186+ ah += int(chS.Size.Height) + d.Gap
184187
185188 // If we need to draw the cursor, keep going
186189 if d.scroll.wantsCursor && i <= d.cursor {
......@@ -194,7 +197,7 @@ func (d *Dynamic) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
194197
195198 var totalHeight uint16
196199 for _, ch := range s.Children {
197- totalHeight += ch.Surface.Size.Height
200+ totalHeight += ch.Surface.Size.Height + uint16(d.Gap)
198201 }
199202
200203 if d.DrawCursor {
Back to top