Augment default click handler with ItemGroup arg

This commit is contained in:
Gabriel Tofvesson 2024-10-04 16:23:40 +02:00
parent 2f895e22b0
commit c6adf1cd09

View File

@ -111,7 +111,9 @@ local function itemList(groups, wBudget, onClick)
countLabel countLabel
}, },
vertical = false, vertical = false,
onClick = onClick onClick = onClick and function(element, x, y, source)
onClick(element, x, y, source, group)
end or nil
} }
table.insert(entries, list) table.insert(entries, list)
end end
@ -165,8 +167,9 @@ local PAGES = {
table.insert(subset, found[i]) table.insert(subset, found[i])
end end
local listResult = itemList(subset, state.width, function(element, x, y, source) local listResult = itemList(subset, state.width, function(element, x, y, source, group)
print("Clicked: "..x.." "..y) print("Clicked: "..group:getDisplayName())
return true
end) end)
listResult:setParent(state.monitor) listResult:setParent(state.monitor)