Work around wxProgressDialog layout bug

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4288
This commit is contained in:
Jon Evans 2021-03-16 20:44:24 -04:00
parent 6d502cb2a5
commit 045160d486
2 changed files with 6 additions and 3 deletions

View File

@ -133,9 +133,10 @@ bool PROGRESS_REPORTER::KeepRefreshing( bool aWait )
WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& aTitle,
int aNumPhases, bool aCanAbort ) :
int aNumPhases, bool aCanAbort,
bool aReserveSpaceForMessage ) :
PROGRESS_REPORTER( aNumPhases ),
wxProgressDialog( aTitle, wxT( "" ), 1, aParent,
wxProgressDialog( aTitle, ( aReserveSpaceForMessage ? wxT( " " ) : wxT( "" ) ), 1, aParent,
// wxPD_APP_MODAL | // Don't use; messes up OSX when called from
// quasi-modal dialog
wxPD_AUTO_HIDE | // *MUST* use; otherwise wxWidgets will spin

View File

@ -141,9 +141,11 @@ public:
* aNumPhases = n creates n virtual progress bar zones: a 0 to 100 percent width
* of a virtual zone fills 0 to 1/n progress bar full size of the nth virtual zone index
* @param aCanAbort is true if the abort button should be shown
* @param aReserveSpaceForMessage will ensure that the dialog is laid out for status messages,
* preventing layout issues on Windows when reporting a message after the initial layout
*/
WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& aTitle, int aNumPhases,
bool aCanAbort = true );
bool aCanAbort = true, bool aReserveSpaceForMessage = true );
~WX_PROGRESS_REPORTER();
/** change the title displayed on the window caption