Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions UnitFrames_Workbench/Entries/Theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ Workbench:Register({
local text = C.Text:New(bar:GetTextParent(), {})
text:SetPoint("CENTER", bar:GetTextParent(), "CENTER")
text:SetText("Theme preview")
local auras = C.Auras:New(bar:GetFrame(), {})
auras:ShowSample({ buffs = UF.Units.SAMPLE.buffs, debuffs = UF.Units.SAMPLE.debuffs })
return Workbench.Composite({
{ key = "bar", label = "Bar", component = bar },
{ key = "text", label = "Text", component = text },
})
{ key = "auras", label = "Aura icons", component = auras },
}, bar:GetFrame())
end,
defaultConfig = { bar = { border = { enabled = true } } },
defaultConfig = { bar = { border = { enabled = true } },
auras = { buffs = { max = 7, size = 22 }, debuffs = { max = 5, size = 22 } } },
styleTarget = ThemeTarget,
})
11 changes: 11 additions & 0 deletions tests/spec/workbench/workbench_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,17 @@ describe("Workbench", function()
assert.is_not_nil(bar)
end)

it("previews sample aura icons that follow the global aura settings", function()
workbench:Select("theme")
local auras = workbench.handle.parts.auras
assert.equals(7, #auras.previewContainers.buffs.ufElements)
assert.equals(5, #auras.previewContainers.debuffs.ufElements)
assert.is_true(auras.previewContainers.debuffs.ufElements[1]:IsShown())
workbench.styleTarget.set("auras.countSize", 15)
assert.equals(15, auras.resolved.countSize)
workbench.styleTarget.set("auras.countSize", nil)
end)

it("toggles forced restrictions and resets them on close", function()
local cvars = {}
C_CVar.SetCVar = function(name, value) cvars[name] = value end
Expand Down
Loading