Commit 5df0f97d authored by Alessandro Portale's avatar Alessandro Portale Committed by Tim Jenssen

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's avatarTim Jenssen <tim.jenssen@qt.io>
parent 89973866
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment