summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/fancyactionbar.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-02-24 19:54:35 +0100
committerJens Bache-Wiig <jbache@trolltech.com>2010-02-24 19:56:33 +0100
commitb7650d343e2ae685dc06a62a32c89e303742901a (patch)
treef8873a69c8466c0eca556ab8d6538a85970af79d /src/plugins/coreplugin/fancyactionbar.cpp
parent7af1e211446d3ab2b67f8bedde191e8482184de0 (diff)
downloadqt-creator-b7650d343e2ae685dc06a62a32c89e303742901a.tar.gz
Fix an icon centering problem on the actionbar
The actualPixmapSize is different from the resulting pixmap when using svg icons. This seems to be a bug in Qt, but using the resulting pixmap is safe for now.
Diffstat (limited to 'src/plugins/coreplugin/fancyactionbar.cpp')
-rw-r--r--src/plugins/coreplugin/fancyactionbar.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp
index 00822110af..66f8a819b6 100644
--- a/src/plugins/coreplugin/fancyactionbar.cpp
+++ b/src/plugins/coreplugin/fancyactionbar.cpp
@@ -105,7 +105,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
painter.drawLine(rect().bottomLeft(), rect().bottomRight());
painter.restore();
} else
-#endif
+#endif
if (isDown() || isChecked()) {
painter.save();
QLinearGradient grad(rect().topLeft(), rect().topRight());
@@ -130,7 +130,6 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
QSizeF halfPixSize = pix.size()/2.0;
painter.drawPixmap(center-QPointF(halfPixSize.width()-1, halfPixSize.height()-1), pix);
-
// draw popup texts
if (isTitledAction) {
QFont normalFont(painter.font());
@@ -155,7 +154,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
penColor = Qt::gray;
painter.setPen(penColor);
const QString projectName = defaultAction()->property("heading").toString();
- QString ellidedProjectName = fm.elidedText(projectName, Qt::ElideMiddle, r.width());
+ QString ellidedProjectName = fm.elidedText(projectName, Qt::ElideMiddle, r.width() - 6);
if (isEnabled()) {
const QRectF shadowR = r.translated(0, 1);
painter.setPen(QColor(30, 30, 30, 80));