From d982ca48c5bdd90388ba8bc2e52ec7e3290f20fb Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sun, 29 Apr 2018 22:42:29 -0700 Subject: [PATCH] Add FocusTracker#Refocus() --- wtf/focus_tracker.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/wtf/focus_tracker.go b/wtf/focus_tracker.go index 88b624a6..e86b93df 100644 --- a/wtf/focus_tracker.go +++ b/wtf/focus_tracker.go @@ -17,10 +17,6 @@ type FocusTracker struct { // Next sets the focus on the next widget in the widget list. If the current widget is // the last widget, sets focus on the first widget. func (tracker *FocusTracker) Next() { - //if tracker.widgetHasFocus() == false { - //return - //} - tracker.blur(tracker.Idx) tracker.increment() tracker.focus(tracker.Idx) @@ -34,15 +30,15 @@ func (tracker *FocusTracker) None() { // Prev sets the focus on the previous widget in the widget list. If the current widget is // the last widget, sets focus on the last widget. func (tracker *FocusTracker) Prev() { - //if tracker.widgetHasFocus() == false { - //return - //} - tracker.blur(tracker.Idx) tracker.decrement() tracker.focus(tracker.Idx) } +func (tracker *FocusTracker) Refocus() { + tracker.focus(tracker.Idx) +} + /* -------------------- Unexported Functions -------------------- */ func (tracker *FocusTracker) blur(idx int) {