From 228b6f09ad41e7f7e3489bd643b6dea002ebe32f Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 3 Apr 2020 12:57:11 +0200 Subject: [PATCH] ui-widgets: use better hooks to avoid ui tainting --- api/ui-widgets.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index 7aae5704..50adff3a 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -586,9 +586,23 @@ function pfUI.api.SkinScrollbar(frame, always) -- always show parent frame if always then RunOOC(function() - parent:Show() - parent.Hide = function(self) frame.thumb:Hide() end - parent.Show = function(self) frame.thumb:Show() end + parent:SetScript("OnHide", function() this:Show() end) + if not up or parent.hooked then return end + + local enable = up.Enable + local disable = up.Disable + + up.Enable = function(self) + if enable then enable(self) end + frame.thumb:Show() + end + + up.Disable = function(self) + if disable then disable(self) end + frame.thumb:Hide() + end + + parent.hooked = true end) end end