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-12-03 15:26:34 -08:00
committed by Jim
parent e8792ac791
commit a18f07d49c
+7 -2
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("-");
}
}