Refactor: one colorFade transition replaces internal.Fade
textInputFade becomes colorFade in theme.go and serves AvatarGroup, Image retry, Tag and EditableText, which used internal.Fade. MyGo already skips element transitions under ReduceMotion, so dropping the Motion check keeps behaviour.
This commit is contained in:
11 files changed
+167
-21
No files matched your search
@@ -2,19 +2,10 @@ package internal
|
||||
|
||||
import (
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/egoist/mygo/ui"
|
||||
)
|
||||
|
||||
// Fade animates e's colors over d; zero skips it.
|
||||
func Fade(e *ui.Element, d time.Duration) *ui.Element {
|
||||
if d > 0 {
|
||||
e.Transition(ui.ElementTransition{Colors: true, Duration: d})
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
// Rule draws a pixel-aligned 1 DIP horizontal line at y.
|
||||
func Rule(p *ui.Painter, x0, x1, y float32, c ui.Color) {
|
||||
yy := ruleY(p, y)
|
||||
|
||||
Reference in new issue
Block a user