From 8d02b7ebfd6885c5a6d6f82cdbf705368d7086b7 Mon Sep 17 00:00:00 2001 From: Artur Morozov Date: Mon, 4 Mar 2019 15:40:19 +0300 Subject: [PATCH] api: update SkinSlider --- api/ui-widgets.lua | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index 340f6fb0..b2a3d9bb 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -501,19 +501,8 @@ function pfUI.api.SkinSlider(frame) local orientation = frame:GetOrientation() local thumb = frame:GetThumbTexture() - if not frame.bg then - frame.bg = CreateFrame("Frame", nil, frame) - frame.bg:SetAllPoints(frame) - CreateBackdrop(frame.bg, nil, true) - end - - if not frame.thumb then - thumb:SetTexture(nil) - frame.thumb = frame.bg:CreateTexture(nil, "ARTWORK") - frame.thumb:SetTexture(1, .82, 0) - frame.thumb:SetPoint("TOPLEFT", thumb, "TOPLEFT", 1, -4) - frame.thumb:SetPoint("BOTTOMRIGHT", thumb, "BOTTOMRIGHT", -1, 4) - end + CreateBackdrop(frame, nil, true) + thumb:SetTexture(1, .82, 0) for i,region in ipairs({frame:GetRegions()}) do if region:GetObjectType() == 'FontString' then @@ -540,10 +529,10 @@ function pfUI.api.SkinSlider(frame) if orientation == 'VERTICAL' then frame:SetWidth(10) thumb:SetHeight(22) - thumb:SetWidth(12) + thumb:SetWidth(frame:GetWidth()) else frame:SetHeight(10) - thumb:SetHeight(17) + thumb:SetHeight(frame:GetHeight()) thumb:SetWidth(17) end end