List fix for monitors
This commit is contained in:
@@ -119,7 +119,7 @@ end
|
|||||||
--- @return boolean Whether the event was handled
|
--- @return boolean Whether the event was handled
|
||||||
--- @protected
|
--- @protected
|
||||||
function List:mouse_click(button, x, y)
|
function List:mouse_click(button, x, y)
|
||||||
if button == 1 and self:isInBounds(x, y) and self.get("selectable") then
|
if self:isInBounds(x, y) and self.get("selectable") then
|
||||||
local _, index = self:getRelativePosition(x, y)
|
local _, index = self:getRelativePosition(x, y)
|
||||||
local adjustedIndex = index + self.get("offset")
|
local adjustedIndex = index + self.get("offset")
|
||||||
local items = self.get("items")
|
local items = self.get("items")
|
||||||
@@ -144,7 +144,7 @@ function List:mouse_click(button, x, y)
|
|||||||
if item.callback then
|
if item.callback then
|
||||||
item.callback(self)
|
item.callback(self)
|
||||||
end
|
end
|
||||||
|
self:fireEvent("mouse_click", button, x, y)
|
||||||
self:fireEvent("select", adjustedIndex, item)
|
self:fireEvent("select", adjustedIndex, item)
|
||||||
self:updateRender()
|
self:updateRender()
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user