Check for window best size in wxPersistentTLW

Ensure that the restored size is at least equal to the best size of the
window to avoid cutting off parts of it in (a common) case when a newer
version of the program adds new UI elements, thus increasing the window
best size and possibly making the previously stored size too small.
This commit is contained in:
Vadim Zeitlin 2017-07-06 15:22:10 +02:00
parent 7092b1112e
commit 5292f77ab4
2 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,7 @@ All (GUI):
- Handle wxST_ELLIPSIZE_XXX styles in wxStaticText XRC handler (tm).
- Add support for bitmaps to wxToggleButton XRC handler (tm).
- Fix wxGCDC::SetDeviceClippingRegion().
- Never restore size smaller than the best one in wxPersistentTLW.
wxGTK:

View File

@ -116,7 +116,14 @@ public:
}
if ( hasSize )
{
// a previous version of the program could have saved the window
// size which used to be big enough, but which is not big enough
// any more for the new version, so check that the size we restore
// doesn't cut off parts of the window
size.IncTo(tlw->GetBestSize());
tlw->SetSize(size);
}
// note that the window can be both maximized and iconized
bool maximized;