Add helper function to create pixmaps from assets with the right resolution for hdpi screens

This commit is contained in:
Luis Ángel San Martín 2022-10-22 16:25:42 +02:00
parent 75c08885be
commit c29eb79d88
2 changed files with 6 additions and 0 deletions

View File

@ -87,3 +87,8 @@ QAction *YACReader::actionWithCustomIcon(const QIcon &icon, QAction *action)
return a;
}
QPixmap YACReader::hdpiPixmap(const QString &file, QSize size)
{
return QIcon(file).pixmap(size);
}

View File

@ -113,6 +113,7 @@ QList<qulonglong> mimeDataToComicsIds(const QMimeData *data);
QString addExtensionToIconPath(const QString &path);
QString addExtensionToIconPathInToolbar(const QString &path);
QAction *actionWithCustomIcon(const QIcon &icon, QAction *action);
QPixmap hdpiPixmap(const QString &file, QSize size);
}
#endif