Externalize widget hit test to style definition.
This commit is contained in:
parent
2e5927e963
commit
6de65888dc
7 changed files with 18 additions and 17 deletions
|
@ -1,11 +1,11 @@
|
|||
local core = require((...):match("(.-)[^%.]+$") .. 'core')
|
||||
|
||||
return function(info, x,y,w,h, draw)
|
||||
return function(info, x,y,w,h, widgetHit, draw)
|
||||
info.text = info.text or ""
|
||||
info.cursor = math.min(info.cursor or info.text:len(), info.text:len())
|
||||
|
||||
local id = core.generateID()
|
||||
core.mouse.updateState(id, x,y,w,h)
|
||||
core.mouse.updateState(id, widgetHit or core.style.widgetHit, x,y,w,h)
|
||||
core.makeCyclable(id)
|
||||
if core.isActive(id) then core.setKeyFocus(id) end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue