handleWidgetStateFromFocus updates standard State flags based on Focus events
()
| 412 | |
| 413 | // handleWidgetStateFromFocus updates standard State flags based on Focus events |
| 414 | func (wb *WidgetBase) handleWidgetStateFromFocus() { |
| 415 | wb.OnFocus(func(e events.Event) { |
| 416 | if wb.AbilityIs(abilities.Focusable) { |
| 417 | wb.ScrollToThis() |
| 418 | wb.SetState(true, states.Focused) |
| 419 | if wb.Styles.VirtualKeyboard != styles.KeyboardNone { |
| 420 | TheApp.ShowVirtualKeyboard(wb.Styles.VirtualKeyboard) |
| 421 | } |
| 422 | } |
| 423 | }) |
| 424 | wb.OnFocusLost(func(e events.Event) { |
| 425 | if wb.AbilityIs(abilities.Focusable) { |
| 426 | wb.SetState(false, states.Focused) |
| 427 | if wb.Styles.VirtualKeyboard != styles.KeyboardNone { |
| 428 | TheApp.HideVirtualKeyboard() |
| 429 | } |
| 430 | } |
| 431 | }) |
| 432 | } |
| 433 | |
| 434 | // HandleWidgetMagnifyEvent calls [renderWindow.stepZoom] on [events.Magnify] |
| 435 | func (wb *WidgetBase) handleWidgetMagnify() { |
no test coverage detected