summaryrefslogtreecommitdiff
path: root/src/libs/utils/detailsbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils/detailsbutton.cpp')
-rw-r--r--src/libs/utils/detailsbutton.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/utils/detailsbutton.cpp b/src/libs/utils/detailsbutton.cpp
index ef38d9b409..5aa4ef91fc 100644
--- a/src/libs/utils/detailsbutton.cpp
+++ b/src/libs/utils/detailsbutton.cpp
@@ -80,10 +80,11 @@ DetailsButton::DetailsButton(QWidget *parent) : QAbstractButton(parent), m_fader
QSize DetailsButton::sizeHint() const
{
// TODO: Adjust this when icons become available!
+ const int w = fontMetrics().width(text()) + 32;
#ifdef Q_WS_MAC
- return QSize(80, 34);
+ return QSize(w, 34);
#else
- return QSize(80, 22);
+ return QSize(w, 22);
#endif
}
@@ -171,6 +172,7 @@ QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
QRect textRect = p.fontMetrics().boundingRect(text());
textRect.setWidth(textRect.width() + 15);
+ textRect.setHeight(textRect.height() + 4);
textRect.moveCenter(rect().center());
p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text());