Commit 45d1f6b3 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Ensure that the current item stays visible

if all tests are shown which may push the current item out of view, and
if a failed test is selected which causes the available space for the
tree view to be reduced by the details on the failed test.

GnuPG-bug-id: 6101
parent c7f4cacf
Pipeline #212338 passed with stage
in 3 minutes and 4 seconds
......@@ -285,6 +285,7 @@ public:
if (checked) {
updateColumnSizes();
}
ensureCurrentItemIsVisible();
});
proxy.setShowAll(ui.showAllCB->isChecked());
......@@ -307,6 +308,7 @@ private:
ui.proposedCorrectiveActionGB->setVisible(!t->passed() && !action.isEmpty());
ui.proposedCorrectiveActionLB->setText(action);
ui.doItPB->setVisible(!t->passed() && t->canFixAutomatically());
QMetaObject::invokeMethod(q, [this]() { ensureCurrentItemIsVisible(); }, Qt::QueuedConnection);
}
}
void slotDoItClicked()
......@@ -318,6 +320,10 @@ private:
}
private:
void ensureCurrentItemIsVisible()
{
ui.resultsTV->scrollTo(ui.resultsTV->currentIndex());
}
void updateColumnSizes()
{
ui.resultsTV->header()->resizeSections(QHeaderView::ResizeToContents);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment