Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions EllesmereUIActionBars/EllesmereUIActionBars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3167,8 +3167,36 @@ function EAB:ApplyBackgroundForBar(barKey)
local padX = s.bgPadX or 0
local padY = s.bgPadY or 0
bg:ClearAllPoints()
bg:SetPoint("TOPLEFT", frame, "TOPLEFT", -padX, padY)
bg:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", padX, -padY)
-- Anchor the background to the actual visible buttons instead of the bar frame
if bg then
bg:ClearAllPoints()

local left, right, top, bottom

for i = 1, (s.numIcons or 0) do
local btn = _G[barKey .. "Button" .. i] or _G["EAB_" .. barKey .. "Button" .. i]

if btn and btn:IsShown() then
local l, r = btn:GetLeft(), btn:GetRight()
local t, b = btn:GetTop(), btn:GetBottom()

if l and r and t and b then
left = left and math.min(left, l) or l
right = right and math.max(right, r) or r
top = top and math.max(top, t) or t
bottom = bottom and math.min(bottom, b) or b
end
end
end

if left and right and top and bottom then
bg:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", left - padX, top + padY)
bg:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMLEFT", right + padX, bottom - padY)
bg:Show()
else
bg:Hide()
end
end
bg:Show()
end

Expand Down