avoid lengthy accelerator details with Nvidia GPUs

This commit is contained in:
Axel Kohlmeyer
2023-08-15 02:26:54 -04:00
parent 0c7f56e881
commit 263db3d13c
2 changed files with 6 additions and 3 deletions

View File

@ -146,10 +146,12 @@ void ImageViewer::reset_view()
antialias = settings.value("antialias", false).toBool();
settings.endGroup();
// reset state of checkable push buttons (only after main layout is set up)
// reset state of checkable push buttons and combo box (after main layout is set up)
auto *lo = layout();
if (lo) {
lo = lo->itemAt(0)->layout();
// grab layout manager for the top bar
lo = lo->itemAt(0)->layout();
// grab the first 4 buttons after the menu bar
auto *button = qobject_cast<QPushButton *>(lo->itemAt(1)->widget());
button->setChecked(usessao);
button = qobject_cast<QPushButton *>(lo->itemAt(2)->widget());
@ -158,6 +160,7 @@ void ImageViewer::reset_view()
button->setChecked(showbox);
button = qobject_cast<QPushButton *>(lo->itemAt(4)->widget());
button->setChecked(showaxes);
// grab the last entry -> group selector
auto *cb = qobject_cast<QComboBox *>(lo->itemAt(lo->count() - 1)->widget());
cb->setCurrentText("all");
}