diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-29 12:08:50 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-29 13:38:43 (GMT) |
commit | 5f027e8e5e430abf54eea4a020ead8ed95e3a211 (patch) | |
tree | 79b7839ca7002ca5b1db339f782ccddbdcad1bed /src | |
parent | 37ecbc1282fcd16442305a0240ea5920ca9a2b2d (diff) | |
download | Qt-5f027e8e5e430abf54eea4a020ead8ed95e3a211.zip Qt-5f027e8e5e430abf54eea4a020ead8ed95e3a211.tar.gz Qt-5f027e8e5e430abf54eea4a020ead8ed95e3a211.tar.bz2 |
QMenu: fixed geometry problem that was adding twice the panel width
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 2f20991..1fd6816 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1711,17 +1711,18 @@ QSize QMenu::sizeHint() const } if (d->tearoff) s.rheight() += style()->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, this); - if (const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, &opt, this)) { - s.rwidth() += fw*2; - s.rheight() += fw*2; - } // Note that the action rects calculated above already include // the top and left margins, so we only need to add margins for // the bottom and right. + if (const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, &opt, this)) { + s.rwidth() += fw; + s.rheight() += fw; + } + s.rwidth() += style()->pixelMetric(QStyle::PM_MenuHMargin, &opt, this); s.rheight() += style()->pixelMetric(QStyle::PM_MenuVMargin, &opt, this); - s += QSize(d->leftmargin + d->rightmargin, d->topmargin + d->bottommargin); + s += QSize(d->rightmargin, d->bottommargin); return style()->sizeFromContents(QStyle::CT_Menu, &opt, s.expandedTo(QApplication::globalStrut()), this); |