From 287a4ed46c6714a0fb03e2f86ccd9fe6167caa3e Mon Sep 17 00:00:00 2001 From: Thorsten42 Date: Fri, 23 Oct 2026 03:48:41 +0200 Subject: [PATCH] Fix panel alignment: center-panel overlap and Quest Log/Friends/Spellbook heights (#63) * Only move the center panel when it overlaps the left panel The panel aligner cached the left panel's rightmost child once and then re-anchored the center panel to that edge on every change. Children that were hidden later (such as Spellbook skill-line tabs) kept pushing the center panel right, and panels that already cleared the left panel were pulled back to the left. Recalculate the rightmost visible child while both panels are shown and only shift the center panel when its backdrop really overlaps. * Align Quest Log, Friends and Spellbook panel heights Most skinned panels draw their backdrop 430px tall, 10px below the frame top (insets 10/-10 and -30/72). Three panels did not match: - Quest Log: frame was 440px and anchored at y -104, so it stood 10px taller than a panel opened beside it. It is now 430px at y -114, with the list/detail panes and visible rows (22) reduced to fit. - Friends: bottom inset was 74 instead of 72. - Spellbook: top-left inset was 12/-12 instead of 10/-10. The Quest Log is a doublewide UI panel. Opening another panel next to it made UpdateUIPanelPositions re-anchor it to the default (0, -104), causing a visible jump. Its UIPanelWindows entry now carries the same x/y offsets as the OnShow anchor. * Let the panel manager place UI panels Remove the OnUpdate panel aligner. UpdateUIPanelPositions already lays out left/center/right panels, and with the overlap-only rule the aligner no longer changed the spacing in normal cases. The Quest Log's UIPanelWindows offsets put it at 10, -114 on every layout pass, so the QuestLog_OnShow re-anchor is redundant. --------- Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com> --- modules/skin.lua | 37 +----------------------------------- skins/blizzard/friends.lua | 4 ++-- skins/blizzard/questlog.lua | 18 +++++++++--------- skins/blizzard/spellbook.lua | 4 ++-- 4 files changed, 14 insertions(+), 49 deletions(-) diff --git a/modules/skin.lua b/modules/skin.lua index 867d4c0d..d7f98e49 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -1,39 +1,4 @@ pfUI:RegisterModule("skin", function () - -- align UIParent panels - pfUI.panelalign = CreateFrame("Frame", "pfUIParentPanelAlign", UIParent) - pfUI.panelalign:SetScript("OnUpdate", function() - -- throttle to 5 updates per second instead of every frame - if (this.tick or 0.2) > GetTime() then return else this.tick = GetTime() + 0.2 end - - local left = UIParent.left - local center = UIParent.center - local rbpos, ropos - - -- detect outer frame backdrops - if left and not left.rightObj then - left.rightObj = left.backdrop or left - for _, frame in pairs({left:GetChildren()}) do - rbpos = frame.backdrop and frame.backdrop.GetRight and frame.backdrop:GetRight() - ropos = left.rightObj and left.rightObj.GetRight and left.rightObj:GetRight() - if rbpos and ropos and rbpos > ropos then - left.rightObj = frame.backdrop - end - end - end - - -- reset anchors - if not left or not left:IsShown() or not center or not center:IsShown() then - UIParent.pfLeftAligned = nil - return - elseif center and center:IsShown() and left and left:IsShown() then - local width = left.rightObj:GetRight() - if width and width ~= UIParent.pfLeftAligned then - center:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", width + 10, -104) - UIParent.pfLeftAligned = width - end - end - end) - -- durability frame pfUI.durability = CreateFrame("Frame", "pfDurability", UIParent) if pfUI.minimap then @@ -79,4 +44,4 @@ pfUI:RegisterModule("skin", function () else UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE") end -end) \ No newline at end of file +end) diff --git a/skins/blizzard/friends.lua b/skins/blizzard/friends.lua index 53973c6a..bd571b7b 100644 --- a/skins/blizzard/friends.lua +++ b/skins/blizzard/friends.lua @@ -8,8 +8,8 @@ pfUI:RegisterSkin("Friends", function () CreateBackdropShadow(FriendsFrame) FriendsFrame.backdrop:SetPoint("TOPLEFT", 8, -10) - FriendsFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74) - FriendsFrame:SetHitRectInsets(8,32,10,74) + FriendsFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 72) + FriendsFrame:SetHitRectInsets(8,32,10,72) EnableMovable("FriendsFrame") SkinCloseButton(FriendsFrameCloseButton, FriendsFrame.backdrop, -6, -6) diff --git a/skins/blizzard/questlog.lua b/skins/blizzard/questlog.lua index adef8344..dc5828af 100644 --- a/skins/blizzard/questlog.lua +++ b/skins/blizzard/questlog.lua @@ -2,19 +2,19 @@ pfUI:RegisterSkin("Quest Log", function () local rawborder, border = GetBorderSize() local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel() - _G.QUESTS_DISPLAYED = 23 + _G.QUESTS_DISPLAYED = 22 _G.MAX_WATCHABLE_QUESTS = 20 -- TODO do -- quest log frame QuestLogQuestCount:ClearAllPoints() QuestLogQuestCount:SetPoint("TOPRIGHT", -10, -30) - hooksecurefunc("QuestLog_OnShow", function() - QuestLogFrame:ClearAllPoints() - QuestLogFrame:SetPoint("TOPLEFT", 10, -104) - end) + -- let the panel manager anchor this doublewide panel at 10, -114 + UIPanelWindows["QuestLogFrame"].xoffset = 10 + UIPanelWindows["QuestLogFrame"].yoffset = -10 - QuestLogFrame:SetSize(676, 440) + -- match the 430px height and top edge of the other skinned panels + QuestLogFrame:SetSize(676, 430) QuestLogFrame:DisableDrawLayer("BACKGROUND") StripTextures(QuestLogFrame, true) @@ -144,7 +144,7 @@ pfUI:RegisterSkin("Quest Log", function () end QuestLogListScrollFrame:SetPoint("TOPLEFT", 10, -54) - QuestLogListScrollFrame:SetHeight(350) + QuestLogListScrollFrame:SetHeight(340) hooksecurefunc("QuestLog_Update", function() local numEntries = GetNumQuestLogEntries() @@ -181,8 +181,8 @@ pfUI:RegisterSkin("Quest Log", function () QuestLogDetailScrollFrame:ClearAllPoints() QuestLogDetailScrollFrame:SetPoint("TOPLEFT", QuestLogListScrollFrame, "TOPRIGHT", 35, 0) - QuestLogDetailScrollFrame:SetHeight(376) - QuestLogDetailScrollChildFrame:SetHeight(376) + QuestLogDetailScrollFrame:SetHeight(366) + QuestLogDetailScrollChildFrame:SetHeight(366) local bg = QuestLogDetailScrollFrame:CreateTexture(nil, "BACKGROUND") bg:SetAllPoints() diff --git a/skins/blizzard/spellbook.lua b/skins/blizzard/spellbook.lua index 4524e9ce..94a0a444 100644 --- a/skins/blizzard/spellbook.lua +++ b/skins/blizzard/spellbook.lua @@ -6,9 +6,9 @@ pfUI:RegisterSkin("Spellbook", function () CreateBackdrop(SpellBookFrame, nil, nil, .75) CreateBackdropShadow(SpellBookFrame) - SpellBookFrame.backdrop:SetPoint("TOPLEFT", 12, -12) + SpellBookFrame.backdrop:SetPoint("TOPLEFT", 10, -10) SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72) - SpellBookFrame:SetHitRectInsets(12,30,12,72) + SpellBookFrame:SetHitRectInsets(10,30,10,72) EnableMovable(SpellBookFrame) SpellBookTitleText:ClearAllPoints()