diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2014-12-27 18:10:34 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-04-13 14:50:27 +0000 |
commit | a5c6bad4f02d78dff2afca84fd0c9fc12c3eaf49 (patch) | |
tree | 1c7215ecfa39581c2f7d0a849c96d312b84889e8 /src/widgets/styles/qfusionstyle.cpp | |
parent | c7364974839e8899a07ef6afba61268028b31faf (diff) |
Take the size and the icon size for MDI buttons from a style
This way they can be DPI-dependent.
Change-Id: I117c337aaa3e2bf6fb85cb3b04bbbccd9db41070
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
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<const QStyleOptionComplex *>(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; |