refactor(color-picker): use closure callbacks

This commit is contained in:
Lemmy
2026-07-24 22:38:38 -04:00
parent c8e31929e6
commit 0e60d401a8
2 changed files with 3 additions and 10 deletions
+1 -8
View File
@@ -219,7 +219,7 @@ local function renderRecentItem(color: string, index: number)
fill = color,
radius = swatch_radius / 2.5,
border = "outline",
onClick = "onHistoryColorClicked" .. index,
onClick = function() handleHistoryClick(index) end,
})
end
@@ -320,13 +320,6 @@ function handleHistoryClick(index: number)
end
end
function onHistoryColorClicked1() handleHistoryClick(1) end
function onHistoryColorClicked2() handleHistoryClick(2) end
function onHistoryColorClicked3() handleHistoryClick(3) end
function onHistoryColorClicked4() handleHistoryClick(4) end
function onHistoryColorClicked5() handleHistoryClick(5) end
function onHistoryColorClicked6() handleHistoryClick(6) end
--==============================================
-- CALLBACKS: colorspace fields (pure UI, no service call)
--==============================================
+2 -2
View File
@@ -3,8 +3,8 @@ id = "oldirtty/color_picker"
name = "Color Picker"
description = "Pick a color from your screen with hyprpicker."
license = "MIT"
version = "1.0.4"
plugin_api = 3
version = "1.0.5"
plugin_api = 9
icon = "palette"
dependencies = ["hyprpicker"]
tags = ["theming", "utility", "bar", "panel"]