Skip to content

Commit f82ac23

Browse files
committed
set dark mode before creating top win
1 parent 651b885 commit f82ac23

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

PyRxCore/PyRxApp.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ ArxTopLevelWindow::ArxTopLevelWindow()
3737
// the wxApp
3838
bool WxRxApp::OnInit()
3939
{
40-
wxTheApp->SetTopWindow(new ArxTopLevelWindow());
41-
if (wxTheApp->GetTopWindow() == nullptr)
42-
return false;
43-
if (Init_wxPython() == false)
44-
return false;
4540
#ifdef WXWIN33
4641
resbuf rb;
47-
if (auto rt = acedGetVar(_T("COLORTHEME"), &rb); rt == RTNORM && rb.restype == RTSHORT && rb.resval.rint == 0)
42+
const auto rt = acedGetVar(_T("COLORTHEME"), &rb);
43+
if (rt == RTNORM && rb.restype == RTSHORT && rb.resval.rint == 0)
4844
{
4945
if (!wxTheApp->MSWEnableDarkMode(wxApp::DarkMode_Always))
5046
acutPrintf(_T("MSWEnableDarkMode failed"));
5147
}
5248
#endif
49+
wxTheApp->SetTopWindow(new ArxTopLevelWindow());
50+
if (wxTheApp->GetTopWindow() == nullptr)
51+
return false;
52+
if (Init_wxPython() == false)
53+
return false;
5354
return true;
5455
}
5556

0 commit comments

Comments
 (0)