mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-27 17:02:04 +08:00
cabana: Add menu item that resets the window layout (#28390)
This commit is contained in:
@@ -32,6 +32,9 @@ MainWindow::MainWindow() : QMainWindow() {
|
||||
createStatusBar();
|
||||
createShortcuts();
|
||||
|
||||
// save default window state to allow resetting it
|
||||
default_state = saveState();
|
||||
|
||||
// restore states
|
||||
restoreGeometry(settings.geometry);
|
||||
if (isMaximized()) {
|
||||
@@ -135,6 +138,10 @@ void MainWindow::createActions() {
|
||||
commands_act->setDefaultWidget(new QUndoView(UndoStack::instance()));
|
||||
commands_menu->addAction(commands_act);
|
||||
|
||||
edit_menu->addSeparator();
|
||||
edit_menu->addAction(tr("Reset Window Layout"),
|
||||
[this]() { restoreState(default_state); });
|
||||
|
||||
tools_menu = menuBar()->addMenu(tr("&Tools"));
|
||||
tools_menu->addAction(tr("Find &Similar Bits"), this, &MainWindow::findSimilarBits);
|
||||
tools_menu->addAction(tr("&Find Signal"), this, &MainWindow::findSignal);
|
||||
|
||||
@@ -98,6 +98,7 @@ protected:
|
||||
QString car_fingerprint;
|
||||
int prev_undostack_index = 0;
|
||||
int prev_undostack_count = 0;
|
||||
QByteArray default_state;
|
||||
friend class OnlineHelp;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user