mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Port away from QApplication::fontMetrics
GIT_SILENT Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
6cc870be1d
commit
69fa7d48e8
@ -394,7 +394,7 @@ QString QzTools::fileSizeToString(qint64 size)
|
||||
|
||||
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 maxWidth = fontMetrics.horizontalAdvance(title.length() > url.length() ? title : url) + 3 * padding + 16;
|
||||
const int width = qMin(maxWidth, 150);
|
||||
|
Loading…
Reference in New Issue
Block a user