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
+1
-4
@@ -72,9 +72,6 @@ func TextInput(c *ui.Context, value *string, opts TextInputOptions) InputResult
|
||||
return r
|
||||
}
|
||||
|
||||
// textInputFade eases hover, focus and error colors.
|
||||
var textInputFade = ui.ElementTransition{Colors: true, Duration: theme.StateDuration}
|
||||
|
||||
// textInputLook is the state a field frame shows; disabled gains any disabled ancestor.
|
||||
type textInputLook struct {
|
||||
disabled, readOnly, area bool
|
||||
@@ -120,7 +117,7 @@ func textInputFrame(c *ui.Context, look *textInputLook, build func(frame *ui.Ele
|
||||
case in.Focused() && !look.readOnly:
|
||||
border = k.Focus
|
||||
}
|
||||
frame.Background(bg).Border(theme.BorderWidth, border).Transition(textInputFade)
|
||||
frame.Background(bg).Border(theme.BorderWidth, border).Transition(colorFade)
|
||||
frame.DrawOver(func(p *ui.Painter, r ui.Rect) {
|
||||
if in.FocusVisible() {
|
||||
internal.FocusRing(p, r, theme.ControlRadius, k.Focus)
|
||||
|
||||
Reference in new issue
Block a user