mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
feat: add keyboard support for button table
This commit is contained in:
@@ -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