feat: add keyboard support for button table
This commit is contained in:
1 parent
8c14613085
commit
a62e7ee34c
4 files changed
+39
-19
No files matched your search
@@ -66,9 +66,7 @@ function Button:init()
|
||||
}
|
||||
}
|
||||
if self.preselect then
|
||||
self.frame.color = Blitbuffer.COLOR_BLACK
|
||||
else
|
||||
self.frame.color = Blitbuffer.gray(0.33)
|
||||
self:onFocus()
|
||||
end
|
||||
self.dimen = self.frame:getSize()
|
||||
self[1] = self.frame
|
||||
@@ -105,12 +103,12 @@ function Button:setIcon(icon)
|
||||
end
|
||||
|
||||
function Button:onFocus()
|
||||
self[1].color = Blitbuffer.COLOR_BLACK
|
||||
self.frame.invert = true
|
||||
return true
|
||||
end
|
||||
|
||||
function Button:onUnfocus()
|
||||
self[1].color = Blitbuffer.gray(0.33)
|
||||
self.frame.invert = false
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user