update updates the visual state
()
| 308 | |
| 309 | // update updates the visual state |
| 310 | func (ed *Edit) update() { |
| 311 | |
| 312 | if !ed.Enabled() { |
| 313 | ed.applyStyle(&ed.styles.Disabled) |
| 314 | return |
| 315 | } |
| 316 | if ed.cursorOver { |
| 317 | ed.applyStyle(&ed.styles.Over) |
| 318 | return |
| 319 | } |
| 320 | if ed.focus { |
| 321 | ed.applyStyle(&ed.styles.Focus) |
| 322 | return |
| 323 | } |
| 324 | ed.applyStyle(&ed.styles.Normal) |
| 325 | } |
| 326 | |
| 327 | // applyStyle applies the specified style |
| 328 | func (ed *Edit) applyStyle(s *EditStyle) { |
no test coverage detected