Use per-window DPI scale factor in wxAuiGenericTabArt
8dcedf56d7 (Add wxWindow parameter to wxAuiTabArt::SetSizingInfo(),
2021-11-13) added "wnd" argument to SetSizingInfo(), so use it instead
of always using the DPI of the main monitor.
This commit is contained in:
@@ -245,7 +245,7 @@ void wxAuiGenericTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
|
||||
|
||||
m_fixedTabWidth = wnd->FromDIP(100);
|
||||
|
||||
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - wxWindow::FromDIP(4, NULL);
|
||||
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - wnd->FromDIP(4);
|
||||
|
||||
if (m_flags & wxAUI_NB_CLOSE_BUTTON)
|
||||
tot_width -= m_activeCloseBmp.GetPreferredSizeFor(wnd).x;
|
||||
@@ -258,12 +258,12 @@ void wxAuiGenericTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
|
||||
}
|
||||
|
||||
|
||||
m_fixedTabWidth = wxMax(m_fixedTabWidth, wxWindow::FromDIP(100, NULL));
|
||||
m_fixedTabWidth = wxMax(m_fixedTabWidth, wnd->FromDIP(100));
|
||||
|
||||
if (m_fixedTabWidth > tot_width/2)
|
||||
m_fixedTabWidth = tot_width/2;
|
||||
|
||||
m_fixedTabWidth = wxMin(m_fixedTabWidth, wxWindow::FromDIP(220, NULL));
|
||||
m_fixedTabWidth = wxMin(m_fixedTabWidth, wnd->FromDIP(220));
|
||||
|
||||
m_tabCtrlHeight = tab_ctrl_size.y;
|
||||
}
|
||||
@@ -976,7 +976,7 @@ void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
|
||||
|
||||
m_fixedTabWidth = wnd->FromDIP(100);
|
||||
|
||||
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - wxWindow::FromDIP(4, NULL);
|
||||
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - wnd->FromDIP(4);
|
||||
|
||||
if (m_flags & wxAUI_NB_CLOSE_BUTTON)
|
||||
tot_width -= m_activeCloseBmp.GetBitmapFor(wnd).GetScaledWidth();
|
||||
@@ -989,12 +989,12 @@ void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
|
||||
}
|
||||
|
||||
|
||||
m_fixedTabWidth = wxMax(m_fixedTabWidth, wxWindow::FromDIP(100, NULL));
|
||||
m_fixedTabWidth = wxMax(m_fixedTabWidth, wnd->FromDIP(100));
|
||||
|
||||
if (m_fixedTabWidth > tot_width/2)
|
||||
m_fixedTabWidth = tot_width/2;
|
||||
|
||||
m_fixedTabWidth = wxMin(m_fixedTabWidth, wxWindow::FromDIP(220, NULL));
|
||||
m_fixedTabWidth = wxMin(m_fixedTabWidth, wnd->FromDIP(220));
|
||||
}
|
||||
|
||||
void wxAuiSimpleTabArt::SetColour(const wxColour& colour)
|
||||
|
||||
Reference in New Issue
Block a user