WIP feedback

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:11:45 -04:00
1 parent 119f9047e9
commit a4b2dbaf13
25 files changed
+2141 -2

No files matched your search

+4 -2
View File
@@ -19,6 +19,7 @@ type SpinnerOptions struct {
}
// Spinner draws four diamonds turning around a center while it shows.
// It repaints only while painted: hidden, it stops. Reduced motion holds it still.
func Spinner(c *ui.Context, opts SpinnerOptions) *ui.Element {
k := Tokens(c)
size := opts.Size
@@ -34,9 +35,10 @@ func Spinner(c *ui.Context, opts SpinnerOptions) *ui.Element {
color = k.AccentText
}
still := c.Preferences().ReduceMotion
row := ui.Row(c).Gap(Density(c).Unit() * 2).AlignItems(ui.Center).Role(ui.RoleProgress).Label(label)
row := ui.Row(c).Gap(Density(c).Unit() * 2).AlignItems(ui.Center)
row.Children(func() {
ui.Box(c).Size(size, size).Shrink(0).Draw(func(p *ui.Painter, r ui.Rect) {
// MyGo's spinner carries the indeterminate progress role.
ui.Spinner(c).Label(label).Size(size, size).Draw(func(p *ui.Painter, r ui.Rect) {
turn := 0.0
if !still {
turn = float64(p.Now().UnixMilli()%1200) / 1200