From 83b7e3e4ffe62867097a7b225a8ececa10a47933 Mon Sep 17 00:00:00 2001 From: MotherGinger <29235654+MotherGinger@users.noreply.github.com> Date: Thu, 20 Jan 2022 01:47:53 -0500 Subject: [PATCH 1/3] Fix #87 - Add backdrop mixin to GameTooltip --- Libraries/LibDropdown-1.0.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Libraries/LibDropdown-1.0.lua b/Libraries/LibDropdown-1.0.lua index 928b4de..fcf6478 100644 --- a/Libraries/LibDropdown-1.0.lua +++ b/Libraries/LibDropdown-1.0.lua @@ -93,8 +93,11 @@ end -- Make the frame match the tooltip local function InitializeFrame(frame) - -- local backdrop = GameTooltip:GetBackdrop() - local backdrop = GameTooltip.NineSlice:GetBackdrop() + if not GameTooltip.GetBackdrop then + Mixin(GameTooltip, BackdropTemplateMixin) + end + + local backdrop = GameTooltip:GetBackdrop() frame:SetBackdrop(backdrop) From 7e8e304756a78c3563735190bd6f708b2b80681b Mon Sep 17 00:00:00 2001 From: MotherGinger <29235654+MotherGinger@users.noreply.github.com> Date: Thu, 20 Jan 2022 02:33:14 -0500 Subject: [PATCH 2/3] Respect the NineSlicePanelTemplate settings --- Libraries/LibDropdown-1.0.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibDropdown-1.0.lua b/Libraries/LibDropdown-1.0.lua index fcf6478..f63017f 100644 --- a/Libraries/LibDropdown-1.0.lua +++ b/Libraries/LibDropdown-1.0.lua @@ -97,13 +97,13 @@ local function InitializeFrame(frame) Mixin(GameTooltip, BackdropTemplateMixin) end - local backdrop = GameTooltip:GetBackdrop() + local backdrop = GameTooltip.NineSlice:GetBackdrop() frame:SetBackdrop(backdrop) if backdrop then - frame:SetBackdropColor(GameTooltip:GetBackdropColor()) - frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor()) + frame:SetBackdropColor(GameTooltip.NineSlice:GetBackdropColor()) + frame:SetBackdropBorderColor(GameTooltip.NineSlice:GetBackdropBorderColor()) end frame:SetScale(GameTooltip:GetScale()) end From 5c76a140a4c1a7515e693edf4ddf733e5ebf8051 Mon Sep 17 00:00:00 2001 From: MotherGinger <29235654+MotherGinger@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:54:02 -0500 Subject: [PATCH 3/3] Remove deprecated backdrop templates, and add defaults --- Libraries/LibDropdown-1.0.lua | 23 +++++++++++++++-------- OutfitterBar.lua | 10 ++++++++++ OutfitterBar.xml | 16 ++++------------ 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Libraries/LibDropdown-1.0.lua b/Libraries/LibDropdown-1.0.lua index f63017f..fecbfe6 100644 --- a/Libraries/LibDropdown-1.0.lua +++ b/Libraries/LibDropdown-1.0.lua @@ -93,18 +93,25 @@ end -- Make the frame match the tooltip local function InitializeFrame(frame) - if not GameTooltip.GetBackdrop then - Mixin(GameTooltip, BackdropTemplateMixin) - end + if not GameTooltip.GetBackdrop then + Mixin(GameTooltip, BackdropTemplateMixin) + end - local backdrop = GameTooltip.NineSlice:GetBackdrop() + if GameTooltip.NineSlice.GetBackdrop then + local backdrop = GameTooltip.NineSlice:GetBackdrop() - frame:SetBackdrop(backdrop) + frame:SetBackdrop(backdrop) - if backdrop then - frame:SetBackdropColor(GameTooltip.NineSlice:GetBackdropColor()) - frame:SetBackdropBorderColor(GameTooltip.NineSlice:GetBackdropBorderColor()) + if backdrop then + frame:SetBackdropColor(GameTooltip.NineSlice:GetBackdropColor()) + frame:SetBackdropBorderColor(GameTooltip.NineSlice:GetBackdropBorderColor()) + end + else + -- If we don't have a backdrop to mimic from the tooltip, use a sane default + -- BACKDROP_DARK_DIALOG_32_32 is a blizzard backdrop global + frame:SetBackdrop(BACKDROP_DARK_DIALOG_32_32) end + frame:SetScale(GameTooltip:GetScale()) end diff --git a/OutfitterBar.lua b/OutfitterBar.lua index ef86d0a..87c33be 100644 --- a/OutfitterBar.lua +++ b/OutfitterBar.lua @@ -1,3 +1,13 @@ +-- Global Backdrops +BACKDROP_OUTFITTER_DIALOG_32_32 = { + bgFile = "Interface\\Addons\\Outfitter\\Textures\\DialogBox-Background", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, + tileSize = 32, + edgeSize = 32, + insets = { left = 11, right = 12, top = 12, bottom = 11 }, +} + ---------------------------------------- Outfitter.OutfitBar = {} ---------------------------------------- diff --git a/OutfitterBar.xml b/OutfitterBar.xml index 982e66f..2bed742 100644 --- a/OutfitterBar.xml +++ b/OutfitterBar.xml @@ -1,18 +1,10 @@ - - - - - - - - - - - - + + + + self:SetFrameLevel(self:GetParent():GetFrameLevel())