UI: Fix slide counter with no slides

When a slideshow is created with no slides, the slide counter
shows value of "1 / 0". Now it shows "- / -".
This commit is contained in:
cg2121 2022-11-24 00:21:35 -06:00 committed by Jim
parent e8792ac791
commit a18f07d49c

View file

@ -510,6 +510,11 @@ void MediaControls::UpdateSlideCounter()
int total = calldata_int(&cd, "total_files");
calldata_free(&cd);
ui->timerLabel->setText(QString::number(slide + 1));
ui->durationLabel->setText(QString::number(total));
if (total > 0) {
ui->timerLabel->setText(QString::number(slide + 1));
ui->durationLabel->setText(QString::number(total));
} else {
ui->timerLabel->setText("-");
ui->durationLabel->setText("-");
}
}