forked from qt-creator/qt-creator
OutputPane: Add Reset to Default to menu
Resetting the visibility of the buttons to the default. Change-Id: I0f8bf1cd9c33ac0a318e992526657c564f51f170 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -783,6 +783,23 @@ void OutputPaneManager::popupMenu()
|
||||
++idx;
|
||||
}
|
||||
|
||||
menu.addSeparator();
|
||||
QAction *reset = menu.addAction(Tr::tr("Reset to Default"));
|
||||
connect(reset, &QAction::triggered, this, [this] {
|
||||
for (int i = 0; i < g_outputPanes.size(); ++i) {
|
||||
OutputPaneData &data = g_outputPanes[i];
|
||||
const bool buttonVisible = data.pane->priorityInStatusBar() >= 0;
|
||||
const bool paneVisible = currentIndex() == i;
|
||||
if (buttonVisible) {
|
||||
data.button->setChecked(paneVisible);
|
||||
data.button->setVisible(true);
|
||||
} else {
|
||||
data.button->setChecked(false);
|
||||
data.button->hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user