diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2017-07-24 19:29:51 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2017-07-24 18:03:34 +0000 |
commit | 5df0f97d2f4f90decbc2fb263704755857416846 (patch) | |
tree | cbfc1b8793bad19b43cbfc5c398c61305330e8aa | |
parent | 8997386675b17394bb78e0c3fb813d538d205aa8 (diff) |
Core: Tweak the wizard icon text overlay
Increasing the text size a bit, making the text darker and making the
margin proportional to the image size (resolution independent).
Change-Id: I029b57e2bf1c355f35161e5f8810dddea4114047
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/plugins/coreplugin/dialogs/newdialog.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 6ffb1e89b7..2254f6c5b6 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -376,14 +376,16 @@ static QIcon iconWithText(const QIcon &icon, const QString &text) QIcon iconWithText; for (const QSize &pixmapSize : icon.availableSizes()) { QPixmap pixmap = icon.pixmap(pixmapSize); + const int fontSize = pixmap.height() / 4; + const int margin = pixmap.height() / 8; QFont font; - font.setPixelSize(qMin(pixmap.height(), pixmap.width()) / 5); + font.setPixelSize(fontSize); + font.setStretch(85); QPainter p(&pixmap); - p.setPen(qRgb(0x6b, 0x70, 0x80)); p.setFont(font); QTextOption textOption(Qt::AlignHCenter | Qt::AlignBottom); textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - p.drawText(pixmap.rect().adjusted(9, 10, -9, -10), text, textOption); + p.drawText(pixmap.rect().adjusted(margin, margin, -margin, -margin), text, textOption); iconWithText.addPixmap(pixmap); } return iconWithText; |