From 8b96643490d3e07ece77a008abff7a43cb830098 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Wed, 18 Feb 2026 22:02:38 +0200 Subject: [PATCH] widget/material: add LayoutWidgets for adding scrollable widgets Signed-off-by: Egon Elbre --- widget/material/list.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/widget/material/list.go b/widget/material/list.go index 1cacedec..5dc75344 100644 --- a/widget/material/list.go +++ b/widget/material/list.go @@ -321,3 +321,10 @@ func (l ListStyle) Layout(gtx layout.Context, length int, w layout.ListElement) return listDims } + +// LayoutWidgets the widgets and its scrollbar. +func (l ListStyle) LayoutWidgets(gtx layout.Context, widgets ...layout.Widget) layout.Dimensions { + return l.Layout(gtx, len(widgets), func(gtx layout.Context, index int) layout.Dimensions { + return widgets[index](gtx) + }) +}