Make the cover selection button circular

This commit is contained in:
Luis Ángel San Martín 2025-05-09 14:05:17 +02:00
parent 0ac22cdc5e
commit b064095809

View File

@ -456,11 +456,6 @@ void PropertiesDialog::loadComic(ComicDB &comic)
showPreviousCoverPageButton->setEnabled(true); showPreviousCoverPageButton->setEnabled(true);
showNextCoverPageButton->setEnabled(true); showNextCoverPageButton->setEnabled(true);
if (coverPage == 1)
showPreviousCoverPageButton->setDisabled(true);
if (coverPage == comic.info.numPages.toInt())
showNextCoverPageButton->setDisabled(true);
coverChanged = false; coverChanged = false;
coverBox->show(); coverBox->show();
@ -469,9 +464,9 @@ void PropertiesDialog::loadComic(ComicDB &comic)
showPreviousCoverPageButton->setDisabled(true); showPreviousCoverPageButton->setDisabled(true);
showNextCoverPageButton->setDisabled(true); showNextCoverPageButton->setDisabled(true);
} }
} else {
coverPageNumberLabel->setText("1");
} }
/*if(comic.info.numPages != NULL)
numPagesEdit->setText(QString::number(*comic.info.numPages));*/
if (!comic.info.number.isNull()) if (!comic.info.number.isNull())
numberEdit->setText(comic.info.number.toString()); numberEdit->setText(comic.info.number.toString());
@ -1093,46 +1088,46 @@ void PropertiesDialog::updateCoverPageNumberLabel(int n)
void PropertiesDialog::loadNextCover() void PropertiesDialog::loadNextCover()
{ {
int current = coverPageNumberLabel->text().toInt(); int current = coverPageNumberLabel->text().toInt();
if (current < comics[currentComicIndex].info.numPages.toInt()) { int next;
updateCoverPageNumberLabel(current + 1);
InitialComicInfoExtractor ie(basePath + comics[currentComicIndex].path, "", current + 1); if (current == comics[currentComicIndex].info.numPages.toInt())
ie.extract(); next = 1;
setCover(ie.getCover()); else
repaint(); next = current + 1;
if ((current + 1) == comics[currentComicIndex].info.numPages.toInt()) { updateCoverPageNumberLabel(next);
showNextCoverPageButton->setDisabled(true);
}
showPreviousCoverPageButton->setEnabled(true); InitialComicInfoExtractor ie(basePath + comics[currentComicIndex].path, "", next);
if (current + 1 != comics[currentComicIndex].info.coverPage) ie.extract();
coverChanged = true; setCover(ie.getCover());
else repaint();
coverChanged = false;
} if (next != comics[currentComicIndex].info.coverPage)
coverChanged = true;
else
coverChanged = false;
} }
void PropertiesDialog::loadPreviousCover() void PropertiesDialog::loadPreviousCover()
{ {
int current = coverPageNumberLabel->text().toInt(); int current = coverPageNumberLabel->text().toInt();
if (current != 1) { int previous;
updateCoverPageNumberLabel(current - 1);
InitialComicInfoExtractor ie(basePath + comics[currentComicIndex].path, "", current - 1);
ie.extract();
setCover(ie.getCover());
repaint();
if ((current - 1) == 1) { if (current == 1)
showPreviousCoverPageButton->setDisabled(true); previous = comics[currentComicIndex].info.numPages.toInt();
} else
previous = current - 1;
showNextCoverPageButton->setEnabled(true); updateCoverPageNumberLabel(previous);
if (current - 1 != comics[currentComicIndex].info.coverPage.toInt()) InitialComicInfoExtractor ie(basePath + comics[currentComicIndex].path, "", previous);
coverChanged = true; ie.extract();
else setCover(ie.getCover());
coverChanged = false; repaint();
}
if (previous != comics[currentComicIndex].info.coverPage.toInt())
coverChanged = true;
else
coverChanged = false;
} }
bool PropertiesDialog::close() bool PropertiesDialog::close()