From a57c192023b1259f212240883421cbe7aacd5d7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 May 2018 00:39:23 +0200 Subject: [PATCH] Adjust wxAuiMDIClientWindow tabs height to icons automatically Don't explicitly set the default icon size, this isn't really necessary and just prevents things from working correctly if the child frames use icons of a different (especially bigger) size. Still try to use the icons of the standard size by default, but let wxAuiNotebook adjust to bigger icons if this is what we have. --- src/aui/tabmdi.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/aui/tabmdi.cpp b/src/aui/tabmdi.cpp index fc55a27e81..97c39cf21c 100644 --- a/src/aui/tabmdi.cpp +++ b/src/aui/tabmdi.cpp @@ -611,8 +611,10 @@ void wxAuiMDIChildFrame::SetIcons(const wxIconBundle& icons) wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); + const wxSize sizeIcon(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), + wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); wxBitmap bmp; - bmp.CopyFromIcon(icons.GetIcon(-1)); + bmp.CopyFromIcon(icons.GetIcon(sizeIcon)); wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); if (pClientWindow != NULL) @@ -723,11 +725,6 @@ bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style) { SetWindowStyleFlag(style); - wxSize caption_icon_size = - wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), - wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); - SetUniformBitmapSize(caption_icon_size); - if (!wxAuiNotebook::Create(parent, wxID_ANY, wxPoint(0,0),