mirror of
https://github.com/YACReader/yacreader
synced 2025-07-20 14:04:40 -04:00
Add support for loading custom comic images
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#include "library_window.h"
|
||||
|
||||
#include "yacreader_global.h"
|
||||
#include "yacreader_global_gui.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QSplitter>
|
||||
@ -2313,12 +2314,7 @@ void LibraryWindow::setFolderCover()
|
||||
|
||||
void LibraryWindow::setCustomFolderCover(Folder folder)
|
||||
{
|
||||
QString supportedImageFormatsString;
|
||||
for (const QByteArray &format : QImageReader::supportedImageFormats()) {
|
||||
supportedImageFormatsString += QString("*.%1 ").arg(QString(format));
|
||||
}
|
||||
|
||||
QString customCoverPath = QFileDialog::getOpenFileName(this, tr("Select custom cover"), QDir::homePath(), tr("Images (%1)").arg(supportedImageFormatsString));
|
||||
auto customCoverPath = YACReader::imageFileLoader(this);
|
||||
if (!customCoverPath.isEmpty()) {
|
||||
QImage cover(customCoverPath);
|
||||
if (cover.isNull()) {
|
||||
|
Reference in New Issue
Block a user