Centre wardrobe tab labels and name the skin for what it covers

The label nudge in the shared tab handler exists to clear the icon on the
talent window's tabs, where the native anchor sits tight against it and
grown text would collide. The wardrobe's category tabs carry no icon and
centre their label, so the same nudge pushed every one of them off to the
right. It's now applied only to tabs that actually have a visible icon.

The settings entry covers three windows, so it's named for all three:
Advancement/Vanity/Wardrobe. The keys behind it move with it -- the db
table is skins.collections, after Collections, the container the three
windows and the tab row all hang off, and talentScale becomes
advancementScale. Nothing here has been released, so there's no stored
setting to migrate.
This commit is contained in:
2026-08-17 22:41:25 +02:00
parent 964f88559d
commit 01f1f5c7c3
3 changed files with 34 additions and 23 deletions
+18 -8
View File
@@ -57,7 +57,7 @@ local CONTAINER_NAME = "Collections"
local scaleKey local scaleKey
local function GetScaleSetting(key) local function GetScaleSetting(key)
local db = CoA.db and CoA.db.profile.skins.talentFrames local db = CoA.db and CoA.db.profile.skins.collections
return (db and db[key]) or 1 return (db and db[key]) or 1
end end
@@ -362,13 +362,23 @@ function Skin:Tab(tab, levelParent)
fontString:SetFont(font, size + TAB_FONT_GROWTH, flags) fontString:SetFont(font, size + TAB_FONT_GROWTH, flags)
end end
-- The label's native anchor sits right off the icon, sized for the -- Only for tabs that actually carry an icon. On those (the talent
-- smaller native font, so grown text collides with the icon. Nudged -- window's) the label's native anchor sits right off the icon, sized
-- off whatever point the native layout gave it rather than a -- for the smaller native font, so grown text collides with it, and
-- hardcoded anchor that would fight that layout. -- the label is nudged off whatever point the native layout gave it
local point, relTo, relPoint, x, y = fontString:GetPoint(1) -- rather than a hardcoded anchor that would fight that layout. The
if point then -- wardrobe's category tabs have no icon and centre their label, so
fontString:SetPoint(point, relTo, relPoint, x + TAB_LABEL_OFFSET, y) -- the same nudge just pushed every one of them off-centre to the
-- right.
local name = tab:GetName()
local icon = name and _G[name.."Icon"]
if icon and icon.GetTexture and icon:GetTexture() and icon:IsShown() then
local point, relTo, relPoint, x, y = fontString:GetPoint(1)
if point then
fontString:SetPoint(point, relTo, relPoint, x + TAB_LABEL_OFFSET, y)
end
end end
end end
+2 -2
View File
@@ -648,7 +648,7 @@ local function SkinFrame(frame)
-- run again on every show rather than once at hook time. The isSkinned -- run again on every show rather than once at hook time. The isSkinned
-- / backdrop guards inside ElvUI's handlers make re-runs cheap. -- / backdrop guards inside ElvUI's handlers make re-runs cheap.
frame:HookScript("OnShow", function(self) frame:HookScript("OnShow", function(self)
Skin:ApplyWindowScale("talentScale") Skin:ApplyWindowScale("advancementScale")
Skin:Title(_G[FRAME_NAME.."TitleText"]) Skin:Title(_G[FRAME_NAME.."TitleText"])
SkinCloseButton(self) SkinCloseButton(self)
SkinBottomBar() SkinBottomBar()
@@ -659,7 +659,7 @@ local function SkinFrame(frame)
end) end)
end end
Skin:ApplyWindowScale("talentScale") Skin:ApplyWindowScale("advancementScale")
Skin:Title(_G[FRAME_NAME.."TitleText"]) Skin:Title(_G[FRAME_NAME.."TitleText"])
SkinCloseButton(frame) SkinCloseButton(frame)
SkinBottomBar() SkinBottomBar()
+14 -13
View File
@@ -18,11 +18,11 @@ local defaults = {
skins = { skins = {
extraActionButton = true, extraActionButton = true,
instanceSwap = true, instanceSwap = true,
talentFrames = { collections = {
enable = true, enable = true,
-- Multipliers on each frame's own scale, so 1 is "as the server -- Multipliers on each frame's own scale, so 1 is "as the server
-- built it" rather than a fixed size. -- built it" rather than a fixed size.
talentScale = 1, advancementScale = 1,
vanityScale = 1, vanityScale = 1,
wardrobeScale = 1, wardrobeScale = 1,
}, },
@@ -86,9 +86,9 @@ local function scaleOption(order, name, key)
min = 0.5, min = 0.5,
max = 1.5, max = 1.5,
step = 0.01, step = 0.01,
get = function() return CoA.db.profile.skins.talentFrames[key] end, get = function() return CoA.db.profile.skins.collections[key] end,
set = function(_, value) set = function(_, value)
CoA.db.profile.skins.talentFrames[key] = value CoA.db.profile.skins.collections[key] = value
if CoA.UpdateFrameScales then if CoA.UpdateFrameScales then
CoA:UpdateFrameScales() CoA:UpdateFrameScales()
@@ -239,25 +239,26 @@ local function getOptions()
-- One entry for the whole talent window: its own frame, the -- One entry for the whole talent window: its own frame, the
-- tab row along its bottom, and the Vanity and Wardrobe -- tab row along its bottom, and the Vanity and Wardrobe
-- windows those tabs open. They're separate frames but one -- windows those tabs open. They're separate frames but one
-- feature to the player, and they're skinned as a set. -- feature to the player, and they're skinned as a set --
talents = { -- named for Collections, the container they all hang off.
collections = {
order = 3, order = 3,
type = "group", type = "group",
name = "Talents", name = "Advancement/Vanity/Wardrobe",
args = { args = {
header = { header = {
order = 1, order = 1,
type = "header", type = "header",
name = "Talents", name = "Advancement/Vanity/Wardrobe",
}, },
enable = { enable = {
order = 2, order = 2,
type = "toggle", type = "toggle",
name = "Enable", name = "Enable",
desc = "Skin the talent window, its tabs, and the Vanity and Wardrobe windows. Requires a UI reload.", desc = "Skin the talent window, its tabs, and the Vanity and Wardrobe windows. Requires a UI reload.",
get = function() return CoA.db.profile.skins.talentFrames.enable end, get = function() return CoA.db.profile.skins.collections.enable end,
set = function(_, value) set = function(_, value)
CoA.db.profile.skins.talentFrames.enable = value CoA.db.profile.skins.collections.enable = value
E:StaticPopup_Show("CONFIG_RL") E:StaticPopup_Show("CONFIG_RL")
end, end,
}, },
@@ -266,9 +267,9 @@ local function getOptions()
type = "group", type = "group",
inline = true, inline = true,
name = "Scale", name = "Scale",
disabled = function() return not CoA.db.profile.skins.talentFrames.enable end, disabled = function() return not CoA.db.profile.skins.collections.enable end,
args = { args = {
talentScale = scaleOption(1, "Talents", "talentScale"), advancementScale = scaleOption(1, "Advancement", "advancementScale"),
vanityScale = scaleOption(2, "Vanity", "vanityScale"), vanityScale = scaleOption(2, "Vanity", "vanityScale"),
wardrobeScale = scaleOption(3, "Wardrobe", "wardrobeScale"), wardrobeScale = scaleOption(3, "Wardrobe", "wardrobeScale"),
}, },
@@ -499,7 +500,7 @@ function CoA:Initialize()
-- One switch for all three: the vanity and wardrobe windows are the talent -- One switch for all three: the vanity and wardrobe windows are the talent
-- frame's own tabs, so skinning one without the others reads as a bug. -- frame's own tabs, so skinning one without the others reads as a bug.
if skins.talentFrames.enable then if skins.collections.enable then
if self.InitializeTalentFrame then if self.InitializeTalentFrame then
self:InitializeTalentFrame() self:InitializeTalentFrame()
end end