mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-16 10:01:29 +03:00
Fix cyclic navigation enabling the next button even if there's only one drive
This commit is contained in:
@@ -170,8 +170,16 @@ void MainWindow::onPrevButtonClicked()
|
|||||||
|
|
||||||
void MainWindow::updateNavigationButtons(qsizetype currentIndex)
|
void MainWindow::updateNavigationButtons(qsizetype currentIndex)
|
||||||
{
|
{
|
||||||
prevButton->setEnabled(currentIndex > 0 || (ui->actionCyclic_Navigation->isChecked() && buttonGroup->buttons().size() > 1)); // We can use setVisible if we want to mimic CrystalDiskInfo
|
const qsizetype totalButtons = buttonGroup->buttons().size();
|
||||||
nextButton->setEnabled(currentIndex < buttonGroup->buttons().size() - 1 || ui->actionCyclic_Navigation->isChecked());
|
const bool isCyclic = ui->actionCyclic_Navigation->isChecked();
|
||||||
|
|
||||||
|
prevButton->setEnabled( // We can use setVisible if we want to mimic CrystalDiskInfo
|
||||||
|
(currentIndex > 0) || (isCyclic && totalButtons > 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
nextButton->setEnabled(
|
||||||
|
(currentIndex < totalButtons - 1) || (isCyclic && totalButtons > 1)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateUI()
|
void MainWindow::updateUI()
|
||||||
|
|||||||
Reference in New Issue
Block a user