diff options
author | Oleg Yadrov <oleg.yadrov@qt.io> | 2017-02-17 11:23:46 -0800 |
---|---|---|
committer | Oleg Yadrov <oleg.yadrov@qt.io> | 2017-02-17 19:29:44 +0000 |
commit | 10d0f4cba99d2386db28a3afd71832e35992b797 (patch) | |
tree | 7ea44c84e77fa7cb7b6b0e8cc677deda8c9c300f /src/widgets/styles/qmacstyle_mac.mm | |
parent | 6c9b5581532388a36328d3fae82ad20c85dce58f (diff) |
QMacStyle::sizeFromContents: don't do anything in CT_Menu case
In this case we can safely return the same QSize which we accept since
it is already contains the right size for the given menu and this size
will be bounded to screen geometry before QMenu will be displayed
anyway. We also get rid of one dependency on HITheme.
Change-Id: I7502a96d180fc4a41ce3dfabe8a200b886016348
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/widgets/styles/qmacstyle_mac.mm')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 007ce20175..238e96ab4f 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -6759,12 +6759,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, break; } case CT_Menu: { - QStyleHintReturnMask menuMask; - QStyleOption myOption = *opt; - myOption.rect.setSize(sz); - if (proxy()->styleHint(SH_Menu_Mask, &myOption, widget, &menuMask)) { - sz = menuMask.region.boundingRect().size(); - } + sz = csz; break; } case CT_HeaderSection:{ const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt); |