From 01f1f5c7c3f184b36f8d80599df1f812541d2006 Mon Sep 17 00:00:00 2001 From: Narcasung Date: Mon, 17 Aug 2026 22:41:25 +0200 Subject: [PATCH] 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. --- Modules/Skinning.lua | 26 ++++++++++++++++++-------- Modules/TalentFrame.lua | 4 ++-- core.lua | 27 ++++++++++++++------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/Modules/Skinning.lua b/Modules/Skinning.lua index d664b63..132956c 100644 --- a/Modules/Skinning.lua +++ b/Modules/Skinning.lua @@ -57,7 +57,7 @@ local CONTAINER_NAME = "Collections" local scaleKey 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 end @@ -362,13 +362,23 @@ function Skin:Tab(tab, levelParent) fontString:SetFont(font, size + TAB_FONT_GROWTH, flags) end - -- The label's native anchor sits right off the icon, sized for the - -- smaller native font, so grown text collides with the icon. Nudged - -- off whatever point the native layout gave it rather than a - -- hardcoded anchor that would fight that layout. - local point, relTo, relPoint, x, y = fontString:GetPoint(1) - if point then - fontString:SetPoint(point, relTo, relPoint, x + TAB_LABEL_OFFSET, y) + -- Only for tabs that actually carry an icon. On those (the talent + -- window's) the label's native anchor sits right off the icon, sized + -- for the smaller native font, so grown text collides with it, and + -- the label is nudged off whatever point the native layout gave it + -- rather than a hardcoded anchor that would fight that layout. The + -- wardrobe's category tabs have no icon and centre their label, so + -- 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 diff --git a/Modules/TalentFrame.lua b/Modules/TalentFrame.lua index 89c1353..73ecfaf 100644 --- a/Modules/TalentFrame.lua +++ b/Modules/TalentFrame.lua @@ -648,7 +648,7 @@ local function SkinFrame(frame) -- run again on every show rather than once at hook time. The isSkinned -- / backdrop guards inside ElvUI's handlers make re-runs cheap. frame:HookScript("OnShow", function(self) - Skin:ApplyWindowScale("talentScale") + Skin:ApplyWindowScale("advancementScale") Skin:Title(_G[FRAME_NAME.."TitleText"]) SkinCloseButton(self) SkinBottomBar() @@ -659,7 +659,7 @@ local function SkinFrame(frame) end) end - Skin:ApplyWindowScale("talentScale") + Skin:ApplyWindowScale("advancementScale") Skin:Title(_G[FRAME_NAME.."TitleText"]) SkinCloseButton(frame) SkinBottomBar() diff --git a/core.lua b/core.lua index bb34049..1b9f486 100644 --- a/core.lua +++ b/core.lua @@ -18,11 +18,11 @@ local defaults = { skins = { extraActionButton = true, instanceSwap = true, - talentFrames = { + collections = { enable = true, -- Multipliers on each frame's own scale, so 1 is "as the server -- built it" rather than a fixed size. - talentScale = 1, + advancementScale = 1, vanityScale = 1, wardrobeScale = 1, }, @@ -86,9 +86,9 @@ local function scaleOption(order, name, key) min = 0.5, max = 1.5, 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) - CoA.db.profile.skins.talentFrames[key] = value + CoA.db.profile.skins.collections[key] = value if CoA.UpdateFrameScales then CoA:UpdateFrameScales() @@ -239,25 +239,26 @@ local function getOptions() -- One entry for the whole talent window: its own frame, the -- tab row along its bottom, and the Vanity and Wardrobe -- windows those tabs open. They're separate frames but one - -- feature to the player, and they're skinned as a set. - talents = { + -- feature to the player, and they're skinned as a set -- + -- named for Collections, the container they all hang off. + collections = { order = 3, type = "group", - name = "Talents", + name = "Advancement/Vanity/Wardrobe", args = { header = { order = 1, type = "header", - name = "Talents", + name = "Advancement/Vanity/Wardrobe", }, enable = { order = 2, type = "toggle", name = "Enable", 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) - CoA.db.profile.skins.talentFrames.enable = value + CoA.db.profile.skins.collections.enable = value E:StaticPopup_Show("CONFIG_RL") end, }, @@ -266,9 +267,9 @@ local function getOptions() type = "group", inline = true, 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 = { - talentScale = scaleOption(1, "Talents", "talentScale"), + advancementScale = scaleOption(1, "Advancement", "advancementScale"), vanityScale = scaleOption(2, "Vanity", "vanityScale"), 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 -- 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 self:InitializeTalentFrame() end