added single background for all frames

This commit is contained in:
Sumsebrum 2021-07-26 17:30:46 +02:00
parent f92b3a4964
commit 751e84c61d
2 changed files with 19 additions and 7 deletions

View File

@ -32,6 +32,12 @@ Gladdy.BUTTON_DEFAULTS = {
function Gladdy:CreateFrame() function Gladdy:CreateFrame()
self.frame = CreateFrame("Frame", "GladdyFrame", UIParent) self.frame = CreateFrame("Frame", "GladdyFrame", UIParent)
self.frame.background = CreateFrame("Frame", nil, self.frame, BackdropTemplateMixin and "BackdropTemplate")
self.frame.background:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = false, tileSize = 16})
self.frame.background:SetFrameStrata("BACKGROUND")
self.frame.background:SetBackdropColor(self.db.backgroundColor.r, self.db.backgroundColor.g, self.db.backgroundColor.b, self.db.backgroundColor.a)
self.frame.background:SetAllPoints(self.frame)
--self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY") --self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY")
--self.frame.texture:SetAllPoints(self.frame) --self.frame.texture:SetAllPoints(self.frame)
--self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp") --self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp")
@ -186,6 +192,8 @@ function Gladdy:UpdateFrame()
self.frame:SetScale(self.db.frameScale) self.frame:SetScale(self.db.frameScale)
self.frame:SetWidth(width) self.frame:SetWidth(width)
self.frame:SetHeight(height) self.frame:SetHeight(height)
self.frame:ClearAllPoints()
self.frame.background:SetBackdropColor(self.db.backgroundColor.r, self.db.backgroundColor.g, self.db.backgroundColor.b, self.db.backgroundColor.a)
--self.frame:SetBackdropColor(self.db.frameColor.r, self.db.frameColor.g, self.db.frameColor.b, self.db.frameColor.a) --self.frame:SetBackdropColor(self.db.frameColor.r, self.db.frameColor.g, self.db.frameColor.b, self.db.frameColor.a)
self.frame:ClearAllPoints() self.frame:ClearAllPoints()
if (self.db.x == 0 and self.db.y == 0) then if (self.db.x == 0 and self.db.y == 0) then

View File

@ -53,7 +53,8 @@ Gladdy.defaults = {
barWidth = 180, barWidth = 180,
bottomMargin = 2, bottomMargin = 2,
statusbarBorderOffset = 6, statusbarBorderOffset = 6,
timerFormat = Gladdy.TIMER_FORMAT.tenths timerFormat = Gladdy.TIMER_FORMAT.tenths,
backgroundColor = {r = 0, g = 0, b = 0, a = 0},
}, },
} }
@ -225,12 +226,6 @@ function Gladdy:SetupOptions()
desc = L["Toggle if frame can be moved"], desc = L["Toggle if frame can be moved"],
order = 1, order = 1,
}, },
growUp = {
type = "toggle",
name = L["Grow frame upwards"],
desc = L["If enabled the frame will grow upwards instead of downwards"],
order = 2,
},
growDirection = { growDirection = {
type = "select", type = "select",
name = L["Grow Direction"], name = L["Grow Direction"],
@ -304,6 +299,15 @@ function Gladdy:SetupOptions()
max = 200, max = 200,
step = 1, step = 1,
}, },
backgroundColor = {
type = "color",
name = L["Background color"],
desc = L["Background Color of the frame"],
order = 8,
hasAlpha = true,
get = getColorOpt,
set = setColorOpt,
},
} }
}, },
cooldownGeneral = { cooldownGeneral = {