From a5c6bad4f02d78dff2afca84fd0c9fc12c3eaf49 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Sat, 27 Dec 2014 18:10:34 +0300 Subject: Take the size and the icon size for MDI buttons from a style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way they can be DPI-dependent. Change-Id: I117c337aaa3e2bf6fb85cb3b04bbbccd9db41070 Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/styles/qfusionstyle.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/widgets/styles/qfusionstyle.cpp') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 5b6e47e2c6..a9cea0e2ab 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -3102,6 +3102,9 @@ int QFusionStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, co case PM_DockWidgetTitleBarButtonMargin: val = 2; break; + case PM_TitleBarButtonSize: + val = 19; + break; case PM_MaximumDragDistance: return -1; // Do not dpi-scale because the value is magic case PM_TabCloseIndicatorWidth: @@ -3225,18 +3228,7 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti newSize += QSize(4, 4); break; case CT_MdiControls: - if (const QStyleOptionComplex *styleOpt = qstyleoption_cast(option)) { - int width = 0; - if (styleOpt->subControls & SC_MdiMinButton) - width += 19 + 1; - if (styleOpt->subControls & SC_MdiNormalButton) - width += 19 + 1; - if (styleOpt->subControls & SC_MdiCloseButton) - width += 19 + 1; - newSize = QSize(width, 19); - } else { - newSize = QSize(60, 19); - } + newSize -= QSize(1, 0); break; default: break; -- cgit v1.2.3