mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Tabbing to widgets properly sets the IsFocused property. Closes #467
This commit is contained in:
parent
7a93824027
commit
042f602ddb
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func (widget *Widget) initializeKeyboardControls() {
|
func (widget *Widget) initializeKeyboardControls() {
|
||||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||||
widget.SetKeyboardChar(" ", widget.Refresh, "Refresh widget")
|
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
|
||||||
widget.SetKeyboardChar("j", widget.displayNext, "Select next item")
|
widget.SetKeyboardChar("j", widget.displayNext, "Select next item")
|
||||||
widget.SetKeyboardChar("k", widget.displayPrev, "Select previous item")
|
widget.SetKeyboardChar("k", widget.displayPrev, "Select previous item")
|
||||||
widget.SetKeyboardChar(" ", widget.toggleChecked, "Toggle checkmark")
|
widget.SetKeyboardChar(" ", widget.toggleChecked, "Toggle checkmark")
|
||||||
|
@ -79,6 +79,8 @@ func (tracker *FocusTracker) Next() {
|
|||||||
tracker.blur(tracker.Idx)
|
tracker.blur(tracker.Idx)
|
||||||
tracker.increment()
|
tracker.increment()
|
||||||
tracker.focus(tracker.Idx)
|
tracker.focus(tracker.Idx)
|
||||||
|
|
||||||
|
tracker.IsFocused = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// None removes focus from the currently-focused widget.
|
// None removes focus from the currently-focused widget.
|
||||||
@ -100,6 +102,8 @@ func (tracker *FocusTracker) Prev() {
|
|||||||
tracker.blur(tracker.Idx)
|
tracker.blur(tracker.Idx)
|
||||||
tracker.decrement()
|
tracker.decrement()
|
||||||
tracker.focus(tracker.Idx)
|
tracker.focus(tracker.Idx)
|
||||||
|
|
||||||
|
tracker.IsFocused = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tracker *FocusTracker) Refocus() {
|
func (tracker *FocusTracker) Refocus() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user