From c6adf1cd0956321f244767f60a797935618d1462 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Fri, 4 Oct 2024 16:23:40 +0200 Subject: [PATCH] Augment default click handler with ItemGroup arg --- itemcontroller.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/itemcontroller.lua b/itemcontroller.lua index 0e5f845..e629e44 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -111,7 +111,9 @@ local function itemList(groups, wBudget, onClick) countLabel }, 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) end @@ -165,8 +167,9 @@ local PAGES = { table.insert(subset, found[i]) end - local listResult = itemList(subset, state.width, function(element, x, y, source) - print("Clicked: "..x.." "..y) + local listResult = itemList(subset, state.width, function(element, x, y, source, group) + print("Clicked: "..group:getDisplayName()) + return true end) listResult:setParent(state.monitor)