mirror of https://github.com/kivy/kivy.git
Merge pull request #2708 from kivy/focus_parachute
uix:FocusBehavior make sure changing focus for previous and next don't c...
This commit is contained in:
commit
91a82a5d4c
|
@ -131,7 +131,8 @@ class ButtonBehavior(object):
|
||||||
self.last_touch = touch
|
self.last_touch = touch
|
||||||
touchtime = time() - self.__touch_time
|
touchtime = time() - self.__touch_time
|
||||||
if touchtime < self.MIN_STATE_TIME:
|
if touchtime < self.MIN_STATE_TIME:
|
||||||
self.__state_event = Clock.schedule_once(self._do_release, self.MIN_STATE_TIME - touchtime)
|
self.__state_event = Clock.schedule_once(
|
||||||
|
self._do_release, self.MIN_STATE_TIME - touchtime)
|
||||||
else:
|
else:
|
||||||
self._do_release()
|
self._do_release()
|
||||||
self.dispatch('on_release')
|
self.dispatch('on_release')
|
||||||
|
@ -795,7 +796,11 @@ class FocusBehavior(object):
|
||||||
next = self._get_focus_next('focus_next')
|
next = self._get_focus_next('focus_next')
|
||||||
if next:
|
if next:
|
||||||
self.focused = False
|
self.focused = False
|
||||||
|
|
||||||
|
def _fn(dt):
|
||||||
next.focused = True
|
next.focused = True
|
||||||
|
|
||||||
|
Clock.schedule_once(_fn)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue