mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Qt: support image playlist in grid layout
This commit is contained in:
parent
c42ad9fbb9
commit
c10e65e99e
@ -2836,6 +2836,32 @@ void MainWindow::addPlaylistItemsToGrid(QString pathString)
|
|||||||
QString thumbnailFileNameNoExt;
|
QString thumbnailFileNameNoExt;
|
||||||
QLabel *newLabel = NULL;
|
QLabel *newLabel = NULL;
|
||||||
QSize thumbnailWidgetSizeHint(screenSize.width() / 8, screenSize.height() / 8);
|
QSize thumbnailWidgetSizeHint(screenSize.width() / 8, screenSize.height() / 8);
|
||||||
|
QByteArray extension;
|
||||||
|
QString extensionStr;
|
||||||
|
QString imagePath;
|
||||||
|
int lastIndex = -1;
|
||||||
|
|
||||||
|
lastIndex = hash["path"].lastIndexOf('.');
|
||||||
|
|
||||||
|
if (lastIndex >= 0)
|
||||||
|
{
|
||||||
|
extensionStr = hash["path"].mid(lastIndex + 1);
|
||||||
|
|
||||||
|
if (!extensionStr.isEmpty())
|
||||||
|
{
|
||||||
|
extension = extensionStr.toLower().toUtf8();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!extension.isEmpty() && m_imageFormats.contains(extension))
|
||||||
|
{
|
||||||
|
/* use thumbnail widgets to show regular image files */
|
||||||
|
imagePath = hash["path"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
imagePath = QString(settings->paths.directory_thumbnails) + "/" + hash.value("db_name") + "/" + THUMBNAIL_BOXART + "/" + thumbnailFileNameNoExt + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
thumbnailFileNameNoExt = hash["label_noext"];
|
thumbnailFileNameNoExt = hash["label_noext"];
|
||||||
thumbnailFileNameNoExt.replace(m_fileSanitizerRegex, "_");
|
thumbnailFileNameNoExt.replace(m_fileSanitizerRegex, "_");
|
||||||
@ -2862,7 +2888,7 @@ void MainWindow::addPlaylistItemsToGrid(QString pathString)
|
|||||||
m_gridLayout->addWidget(item->widget);
|
m_gridLayout->addWidget(item->widget);
|
||||||
m_gridItems.append(item);
|
m_gridItems.append(item);
|
||||||
|
|
||||||
loadImageDeferred(item, QString(settings->paths.directory_thumbnails) + "/" + hash.value("db_name") + "/" + THUMBNAIL_BOXART + "/" + thumbnailFileNameNoExt + ".png");
|
loadImageDeferred(item, imagePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user