diff options
Diffstat (limited to 'src/widgets/widgets/qmdisubwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 610cb1201f..afe87c6af9 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -412,6 +412,10 @@ bool ControlLabel::event(QEvent *event) { if (event->type() == QEvent::WindowIconChange) updateWindowIcon(); + else if (event->type() == QEvent::StyleChange) { + updateWindowIcon(); + setFixedSize(label.size()); + } #ifndef QT_NO_TOOLTIP else if (event->type() == QEvent::ToolTip) { QStyleOptionTitleBar options; @@ -480,7 +484,8 @@ void ControlLabel::updateWindowIcon() QIcon menuIcon = windowIcon(); if (menuIcon.isNull()) menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, parentWidget()); - label = menuIcon.pixmap(16, 16); + const int iconSize = style()->pixelMetric(QStyle::PM_TitleBarButtonIconSize, 0, parentWidget()); + label = menuIcon.pixmap(iconSize); update(); } @@ -556,7 +561,8 @@ QSize ControllerWidget::sizeHint() const ensurePolished(); QStyleOptionComplex opt; initStyleOption(&opt); - QSize size(48, 16); + const int buttonSize = style()->pixelMetric(QStyle::PM_TitleBarButtonSize, &opt, mdiArea); + QSize size(3 * buttonSize, buttonSize); return style()->sizeFromContents(QStyle::CT_MdiControls, &opt, size, mdiArea); } @@ -1769,7 +1775,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const if (isChildOfTabbedQMdiArea(q)) return false; -#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM) +#if defined(Q_OS_DARWIN) && !defined(QT_NO_STYLE_MAC) Q_UNUSED(isChildOfQMdiSubWindow); return true; #else |