Originally Posted by Baertram
Tahnks for the help. Couldn't get your code to work so far but I noticed the layout will get restored properly if I simply click the chat's right or top edge (where you could resize it).
So this code helps to restore the layout properly at a PlayerActivated event callback:
Code:
--Fix for the chat tabs moved into overflow container, introduced with patch 1.7
--Rebuild the chat layout for the primary container
if CHAT_SYSTEM.primaryContainer ~= nil then
CHAT_SYSTEM.primaryContainer:PerformLayout()
end
|
Yes calling
Lua Code:
CHAT_SYSTEM.primaryContainer:PerformLayout()
will also fix the problem as long as its done AFTER the settings.width is restored to the chat container.
And yes clicking on the edge of the chat window does also fix it because it calls, I'm at work I forget what it was called, but some drag/resizing function that forces a call to PerformLayout() for you which fixes it.
But, the code I posted did not work for you?? That is very strange, it should work, unless you have something else changing the dimensions of the chat window and messing it up again....or there is also another problem somewhere that I did not see.
- With my code, when does it mess up for you? Is it messed up on /reloadui?
- Did you try it without any other addons?
The code you posted has basically the same effect. The only difference is your letting it put the tabs in the overflow container & then fixing it. In my code I fixed it before they even get put into the overflow container area because in my code the settings.width is reset before
Lua Code:
SharedChatContainer.LoadSettings(self, settings)
is called, which calls
Lua Code:
CHAT_SYSTEM.primaryContainer:PerformLayout()
for you, which is why I switched them, also you can compare code from the old version and see that is how they broke it. In the previous version there was no ChatContainer:LoadSettings(settings), but instead they only called
Lua Code:
function SharedChatContainer:LoadSettings(settings)
self.settings = settings
-- Notice this is the code from ChatContainer:LoadSettings()
self.control:ClearAnchors()
self.control:SetAnchor(settings.point, nil, settings.relPoint, settings.x, settings.y)
self.control:SetDimensions(settings.width, settings.height)
... more code...
end
But notice they used to reset the settings.width BEFORE any other code in this function ran. They just moved the anchor & setDimensions out into its own function ChatContainer:LoadSettings() but when they did they reversed the order the code was run in which is what messed it up.