1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Port away from QApplication::fontMetrics

GIT_SILENT

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2023-12-17 03:17:43 +01:00
parent 6cc870be1d
commit 69fa7d48e8
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B

View File

@ -394,7 +394,7 @@ QString QzTools::fileSizeToString(qint64 size)
QPixmap QzTools::createPixmapForSite(const QIcon &icon, const QString &title, const QString &url) QPixmap QzTools::createPixmapForSite(const QIcon &icon, const QString &title, const QString &url)
{ {
const QFontMetrics fontMetrics = QApplication::fontMetrics(); const QFontMetricsF fontMetrics(QApplication::font());
const int padding = 4; const int padding = 4;
const int maxWidth = fontMetrics.horizontalAdvance(title.length() > url.length() ? title : url) + 3 * padding + 16; const int maxWidth = fontMetrics.horizontalAdvance(title.length() > url.length() ? title : url) + 3 * padding + 16;
const int width = qMin(maxWidth, 150); const int width = qMin(maxWidth, 150);