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.
This commit is contained in:
@@ -611,8 +611,10 @@ void wxAuiMDIChildFrame::SetIcons(const wxIconBundle& icons)
|
|||||||
wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame();
|
wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame();
|
||||||
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
|
wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame"));
|
||||||
|
|
||||||
|
const wxSize sizeIcon(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X),
|
||||||
|
wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y));
|
||||||
wxBitmap bmp;
|
wxBitmap bmp;
|
||||||
bmp.CopyFromIcon(icons.GetIcon(-1));
|
bmp.CopyFromIcon(icons.GetIcon(sizeIcon));
|
||||||
|
|
||||||
wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow();
|
wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow();
|
||||||
if (pClientWindow != NULL)
|
if (pClientWindow != NULL)
|
||||||
@@ -723,11 +725,6 @@ bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style)
|
|||||||
{
|
{
|
||||||
SetWindowStyleFlag(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,
|
if (!wxAuiNotebook::Create(parent,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxPoint(0,0),
|
wxPoint(0,0),
|
||||||
|
Reference in New Issue
Block a user