Add display components 041-065; move Icon into display; QR via rsc.io/qr

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 18:37:54 -04:00
1 parent 59fde4096d
commit 0247a130f5
41 files changed
+2152 -44

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package display
import (
"github.com/egoist/mygo/ui"
"git.zacharyzhang.com/ZacharyZhang-NY/8bitMyGoUI/pixel"
)
type FigureOptions struct {
// Slot inks the caption; zero means Faint.
Slot pixel.Slot
}
// Figure shows content over a centered caption.
func Figure(c *ui.Context, caption string, o FigureOptions, content func()) *ui.Element {
k := pixel.K(c)
return ui.Column(c).Gap(k.D(3)).AlignItems(ui.Center).Role(ui.RoleGroup).Label(caption).Children(func() {
content()
pixel.Text(c, caption, pixel.TextOptions{Slot: slotOr(o.Slot, pixel.Faint)})
})
}