WIP feedback
This commit is contained in:
25 files changed
+2141
-2
No files matched your search
+4
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user