mirror of https://github.com/PCSX2/pcsx2.git
GUI-WX: Restore panel size override.
Fixes the panels going wonky after the recent dead code removal
This commit is contained in:
parent
41e8a2a7d1
commit
631ed8c0fd
|
@ -124,6 +124,32 @@ int pxStaticText::calcPaddingHeight(int newHeight) const
|
|||
return (int)(newHeight * m_paddingPct_vert * 2) + (m_paddingPix_vert * 2);
|
||||
}
|
||||
|
||||
// Overloaded form wxPanel and friends.
|
||||
wxSize pxStaticText::DoGetBestSize() const
|
||||
{
|
||||
wxClientDC dc(const_cast<pxStaticText*>(this));
|
||||
dc.SetFont(GetFontOk());
|
||||
|
||||
wxSize best;
|
||||
|
||||
if (m_autowrap)
|
||||
{
|
||||
best = GetBestWrappedSize(dc);
|
||||
//best.x = wxDefaultCoord;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No autowrapping, so we can force a specific size here!
|
||||
best = dc.GetMultiLineTextExtent(GetLabel());
|
||||
best.x += calcPaddingWidth(best.x);
|
||||
}
|
||||
|
||||
best.y += calcPaddingHeight(best.y);
|
||||
|
||||
CacheBestSize(best);
|
||||
return best;
|
||||
}
|
||||
|
||||
wxSize pxStaticText::GetBestWrappedSize(const wxClientDC& dc) const
|
||||
{
|
||||
pxAssert(m_autowrap);
|
||||
|
|
|
@ -57,6 +57,7 @@ protected:
|
|||
bool AcceptsFocus() const { return false; }
|
||||
bool HasTransparentBackground() { return true; }
|
||||
void DoSetSize(int x, int y, int w, int h, int sizeFlags = wxSIZE_AUTO);
|
||||
wxSize DoGetBestSize() const;
|
||||
|
||||
public:
|
||||
pxStaticText(wxWindow* parent, const wxString& label, wxAlignment align = wxALIGN_CENTRE_HORIZONTAL);
|
||||
|
|
Loading…
Reference in New Issue