Stop disabled buttons taking the hover border colour

S:HandleButton ends with an unconditional OnEnter/OnLeave pair that swaps
the border to the value colour and back, and neither handler looks at
IsEnabled. A disabled button still fires both scripts on this client, so
the greyed Activate button, Save changes with nothing pending and Purchase
with nothing selected all lit up under the cursor and read as clickable.

HookScript can't be undone, but handlers fire in registration order, so a
hook registered after HandleButton runs last and has the final say on the
colour. Skin:Button wraps HandleButton with that hook, and every call site
in the plugin now goes through it, so the correction is inherited rather
than repeated per module.

The Activate button carries the border from its own update as well:
activating a spec disables it under the very cursor that just clicked it,
and OnEnter has been and gone by then, so nothing else would put the border
back until the pointer moved off.

Skin:IsEnabled hoists the 0/1-to-boolean normalisation this client needs
out of UpdateActivateState, which held the only copy of it.
This commit is contained in:
2026-08-18 16:30:27 +02:00
parent cddfc7e7af
commit d2e55eb3cb
4 changed files with 89 additions and 17 deletions
+4 -4
View File
@@ -8,9 +8,9 @@ local FRAME_NAME = "AppearanceWardrobeFrame"
-- Standard UIPanelButtonTemplate art, same as Vanity's action buttons --
-- S:HandleButton's own texture clearing handles these directly.
local function SkinActionButtons()
S:HandleButton(_G[FRAME_NAME.."PlayerModelSaveOutfitButton"])
S:HandleButton(_G[FRAME_NAME.."DisableTransmogButton"])
S:HandleButton(_G[FRAME_NAME.."DisableSpellVisualsButton"])
Skin:Button(_G[FRAME_NAME.."PlayerModelSaveOutfitButton"])
Skin:Button(_G[FRAME_NAME.."DisableTransmogButton"])
Skin:Button(_G[FRAME_NAME.."DisableSpellVisualsButton"])
end
-- Apply and Cancel only exist while a transmog change is pending, which is why
@@ -46,7 +46,7 @@ local function SkinPendingButton(name)
-- Stripped before templating: HandleButton adds its backdrop as regions of
-- this same button, so a strip afterwards takes the backdrop with the pill.
S:HandleButton(button)
Skin:Button(button)
local text = button.GetFontString and button:GetFontString()
if text then text:SetTextColor(unpack(LABEL_COLOR)) end