make HotkeyLabels react to clicking

also be better about initializing EditField frame height
develop
myk002 2022-07-17 16:04:36 -07:00
parent 5723b76585
commit 7f302888ec
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 15 additions and 1 deletions

@ -187,10 +187,14 @@ EditField.ATTRS{
on_submit2 = DEFAULT_NIL,
key = DEFAULT_NIL,
key_sep = DEFAULT_NIL,
frame = {h=1},
modal = false,
}
function EditField:preinit(init_table)
local frame = init_table.frame or {}
frame.h = frame.h or 1
end
function EditField:init()
local function on_activate()
self.saved_text = self.text
@ -744,6 +748,16 @@ function HotkeyLabel:init()
on_activate=self.on_activate}}
end
function HotkeyLabel:onInput(keys)
if HotkeyLabel.super.onInput(self, keys) then
return true
elseif keys._MOUSE_L and self:getMousePos() then
self.on_activate()
return true
end
end
----------------------
-- CycleHotkeyLabel --
----------------------