From f6708bb907a380cd6f2f678abbd38917b2fa3b48 Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 31 Dec 2021 11:26:55 +0100 Subject: [PATCH] ui-widgets: use existing icon if available --- api/ui-widgets.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index ef643421..bd8375be 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -674,9 +674,10 @@ function pfUI.api.SkinCollapseButton(button, all) local b = _G[button] if not b then b = button end if not b then return end - - b.icon = CreateFrame("Button", b:GetName().."CollapseButton", b) + local name = b:GetName() .. "CollapseButton" local size = 10 + + b.icon = _G[name] or CreateFrame("Button", name, b) if all then size = 14 end b.icon:SetWidth(size) b.icon:SetHeight(size)