diff --git a/gfx/padding.lua b/gfx/padding.lua index 0f68ea1..3a470ff 100644 --- a/gfx/padding.lua +++ b/gfx/padding.lua @@ -110,16 +110,18 @@ function Padding:findById(id) end function Padding:handleEvent(evt) - if Element.handleEvent(self, evt) then - return true - end - local evtLocalCoords = Event.toElementLocalPosition(evt, self) if Event.isClickEvent(evt) then - return Event.containsClick(self, evt) and self.element:handleEvent(evtLocalCoords) + if Event.containsClick(self, evt) and self.element:handleEvent(evtLocalCoords) then + return true + end else - return self.element:handleEvent(evtLocalCoords) + if self.element:handleEvent(evtLocalCoords) then + return true + end end + + return Element.handleEvent(self, evt) end function Padding:_reload() diff --git a/itemcontroller.lua b/itemcontroller.lua index ba4b53d..ebca403 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -50,6 +50,10 @@ local function isLocked() return fs.exists(LOCK_FILE) end +local function ignoreClick() + return true +end + local function saveState(fname, ctrl) local ser = ctrl:toSerializable() local file = fs.open(fname, "w+") @@ -385,7 +389,8 @@ local PAGES = { Padding:new{ id = GroupEntryID.PADDING, bgColor = bgColor, - element = Text:new{ id = GroupEntryID.NAME, bgColor = bgColor, fgColor = fgColor } + element = Text:new{ id = GroupEntryID.NAME, bgColor = bgColor, fgColor = fgColor }, + onClick = ignoreClick }, Text:new{ id = GroupEntryID.COUNT, @@ -428,7 +433,7 @@ local PAGES = { for i=1,#chars do local key = chars:sub(i, i) -- ((not backspace) and i == #keys and 0) or 1 - table.insert(keys, Padding:new{ bgColor = KEYBOARD_BG_COLOR, right = 1, element = Text:new{ + table.insert(keys, Padding:new{ onClick = ignoreClick, bgColor = KEYBOARD_BG_COLOR, right = 1, element = Text:new{ id = key, text = key, bgColor = KEYBOARD_KEY_COLOR, @@ -476,7 +481,7 @@ local PAGES = { } table.insert(keyboardLines.elements, 1, paddedFilterText) - local keyboardList = Padding:new{ bgColor = KEYBOARD_BG_COLOR, left = KEYBOARD_HPAD, right = KEYBOARD_HPAD, top = KEYBOARD_VPAD, bottom = KEYBOARD_VPAD, element = List:new{ + local keyboardList = Padding:new{ onClick = ignoreClick, bgColor = KEYBOARD_BG_COLOR, left = KEYBOARD_HPAD, right = KEYBOARD_HPAD, top = KEYBOARD_VPAD, bottom = KEYBOARD_VPAD, element = List:new{ bgColor = KEYBOARD_BG_COLOR, [Orientation:getId()] = Orientation.VERTICAL, [Children:getId()] = keyboardLines.elements