summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-07-28 10:21:30 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-07-28 10:24:07 (GMT)
commita3497fbde4efd0634c8a5ba452e6278cae836b90 (patch)
tree87e52a8b26b3c07e1baa0ae0fb253cacd937f11b /src/gui
parentd22d08f3f8a70edfc66c0f6c2fd952688b64fcc2 (diff)
downloadQt-a3497fbde4efd0634c8a5ba452e6278cae836b90.zip
Qt-a3497fbde4efd0634c8a5ba452e6278cae836b90.tar.gz
Qt-a3497fbde4efd0634c8a5ba452e6278cae836b90.tar.bz2
Fix menubar item size incorrect with icon
When you have an icon set we do not show the text label, but the previous code would still use the text for the size hint calculation. Task-number: 218836 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qmenubar.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 1cfb9b3..a3964f7 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -446,13 +446,12 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
continue; //we don't really position these!
} else {
const QString s = action->text();
- if(!s.isEmpty()) {
- sz = fm.size(Qt::TextShowMnemonic, s);
- }
-
QIcon is = action->icon();
+ // If an icon is set, only the icon is visible
if (!is.isNull())
sz = sz.expandedTo(QSize(icone, icone));
+ else if (!s.isEmpty())
+ sz = fm.size(Qt::TextShowMnemonic, s);
}
//let the style modify the above size..