Initialize wxAuiToolBar values in pixels after creating it

Don't use FromDIP() before the window is created, this doesn't work
correctly in wxMSW.

See #22193.
This commit is contained in:
Vadim Zeitlin 2022-03-19 22:59:33 +01:00
parent 259c0fd335
commit 630612e2c9

View File

@ -854,8 +854,6 @@ void wxAuiToolBar::Init()
m_actionItem = NULL; m_actionItem = NULL;
m_tipItem = NULL; m_tipItem = NULL;
m_art = new wxAuiDefaultToolBarArt; m_art = new wxAuiDefaultToolBarArt;
m_toolPacking = FromDIP(2);
m_toolBorderPadding = FromDIP(3);
m_toolTextOrientation = wxAUI_TBTOOL_TEXT_BOTTOM; m_toolTextOrientation = wxAUI_TBTOOL_TEXT_BOTTOM;
m_gripperSizerItem = NULL; m_gripperSizerItem = NULL;
m_overflowSizerItem = NULL; m_overflowSizerItem = NULL;
@ -879,6 +877,9 @@ bool wxAuiToolBar::Create(wxWindow* parent,
m_windowStyle = style; m_windowStyle = style;
m_toolPacking = FromDIP(2);
m_toolBorderPadding = FromDIP(3);
m_gripperVisible = (style & wxAUI_TB_GRIPPER) ? true : false; m_gripperVisible = (style & wxAUI_TB_GRIPPER) ? true : false;
m_overflowVisible = (style & wxAUI_TB_OVERFLOW) ? true : false; m_overflowVisible = (style & wxAUI_TB_OVERFLOW) ? true : false;