From 0e60d401a8766505321f50b12eb70cf5fec1bdd2 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Fri, 24 Jul 2026 22:38:38 -0400 Subject: [PATCH] refactor(color-picker): use closure callbacks --- color_picker/panel.luau | 9 +-------- color_picker/plugin.toml | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/color_picker/panel.luau b/color_picker/panel.luau index d601d2b..ee7280e 100644 --- a/color_picker/panel.luau +++ b/color_picker/panel.luau @@ -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) --============================================== diff --git a/color_picker/plugin.toml b/color_picker/plugin.toml index 95e4ca9..42a5a6b 100644 --- a/color_picker/plugin.toml +++ b/color_picker/plugin.toml @@ -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"]