diff --git a/common/widgets/app_progress_dialog.cpp b/common/widgets/app_progress_dialog.cpp index 139d114295..8a56c494d7 100644 --- a/common/widgets/app_progress_dialog.cpp +++ b/common/widgets/app_progress_dialog.cpp @@ -28,7 +28,7 @@ APP_PROGRESS_DIALOG::APP_PROGRESS_DIALOG( const wxString& aTitle, const wxString& aMessage, int aMaximum, wxWindow* aParent, bool aIndeterminateTaskBarStatus, int aStyle ) - : wxProgressDialog( aTitle, + : APP_PROGRESS_DIALOG_BASE( aTitle, aMessage == wxEmptyString ? wxString( wxT( " " ) ) : aMessage, aMaximum, aParent, aStyle ), m_appProgressIndicator( aParent, aMaximum ), @@ -49,5 +49,5 @@ bool APP_PROGRESS_DIALOG::Update( int aValue, const wxString& aNewMsg, bool* aSk m_appProgressIndicator.SetValue( aValue ); } - return wxProgressDialog::Update( aValue, aNewMsg, aSkip ); + return APP_PROGRESS_DIALOG_BASE::Update( aValue, aNewMsg, aSkip ); } diff --git a/common/widgets/wx_progress_reporters.cpp b/common/widgets/wx_progress_reporters.cpp index 5dd9a504f4..e57662a3f9 100644 --- a/common/widgets/wx_progress_reporters.cpp +++ b/common/widgets/wx_progress_reporters.cpp @@ -33,7 +33,7 @@ WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& a int aNumPhases, int aCanAbort, bool aReserveSpaceForMessage ) : PROGRESS_REPORTER_BASE( aNumPhases ), - wxProgressDialog( aTitle, + WX_PROGRESS_REPORTER_BASE( aTitle, ( aReserveSpaceForMessage ? wxT( " " ) : wxT( "" ) ), 1, aParent, // wxPD_APP_MODAL | // Don't use; messes up OSX when called from @@ -93,7 +93,7 @@ bool WX_PROGRESS_REPORTER::updateUI() } // Returns false when cancelled (if it's a cancellable dialog) - bool diag = wxProgressDialog::Update( cur, message ); + bool diag = WX_PROGRESS_REPORTER_BASE::Update( cur, message ); return diag; } diff --git a/include/widgets/app_progress_dialog.h b/include/widgets/app_progress_dialog.h index 4347c77444..9f5e4b616a 100644 --- a/include/widgets/app_progress_dialog.h +++ b/include/widgets/app_progress_dialog.h @@ -27,10 +27,17 @@ #include #include +#if defined( _WIN32 ) && wxCHECK_VERSION(3,3,0) +// In order to get a dark mode compatible progress dialog on Windows with wx 3.3 +#define APP_PROGRESS_DIALOG_BASE wxGenericProgressDialog +#else +#define APP_PROGRESS_DIALOG_BASE wxProgressDialog +#endif + /** * wxProgressDialog with the option to also update the application progress on the taskbar */ -class APP_PROGRESS_DIALOG : public wxProgressDialog +class APP_PROGRESS_DIALOG : public APP_PROGRESS_DIALOG_BASE { public: APP_PROGRESS_DIALOG( const wxString& aTitle, const wxString& aMessage, int aMaximum = 100, diff --git a/include/widgets/wx_progress_reporters.h b/include/widgets/wx_progress_reporters.h index c2b4c528fc..3009eb3ee5 100644 --- a/include/widgets/wx_progress_reporters.h +++ b/include/widgets/wx_progress_reporters.h @@ -36,13 +36,21 @@ #define PR_NO_ABORT 0 #define PR_CAN_ABORT wxPD_CAN_ABORT + +#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 ) +// In order to get a dark mode compatible progress dialog on Windows with wx 3.3 +#define WX_PROGRESS_REPORTER_BASE wxGenericProgressDialog +#else +#define WX_PROGRESS_REPORTER_BASE wxProgressDialog +#endif + /** * Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting * back of work status. * * @see PROGRESS_REPORTER. */ -class WX_PROGRESS_REPORTER : public PROGRESS_REPORTER_BASE, public wxProgressDialog +class WX_PROGRESS_REPORTER : public PROGRESS_REPORTER_BASE, public WX_PROGRESS_REPORTER_BASE { public: /** @@ -69,7 +77,7 @@ public: */ void SetTitle( const wxString& aTitle ) override { - wxProgressDialog::SetTitle( aTitle ); + WX_PROGRESS_REPORTER_BASE::SetTitle( aTitle ); } private: