fix: support self.selected override for FocusManager

pull/1635/head
Qingping Hou 9 years ago
parent 63e88baf33
commit 8c14613085

@ -32,7 +32,9 @@ local FocusManager = InputContainer:new{
}
function FocusManager:init()
self.selected = { x = 1, y = 1 }
if not self.selected then
self.selected = { x = 1, y = 1 }
end
self.key_events = {
-- these will all generate the same event, just with different arguments
FocusUp = { {"Up"}, doc = "move focus up", event = "FocusMove", args = {0, -1} },
@ -60,7 +62,7 @@ function FocusManager:onFocusMove(args)
break -- abort when we run into horizontal borders
end
-- move cyclic in vertical direction
-- call widget wrap callbacks in vertical direction
if self.selected.y + dy > #self.layout then
if not self:onWrapLast() then
break

Loading…
Cancel
Save