From b35ffa5e4133ead0e5e782c0283386e779c79cf6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Dec 2021 21:05:33 +0000 Subject: [PATCH] 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. --- src/aui/tabart.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aui/tabart.cpp b/src/aui/tabart.cpp index ef12247cc7..e7aea1f3ba 100644 --- a/src/aui/tabart.cpp +++ b/src/aui/tabart.cpp @@ -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)