diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c71869fe..8c22c2bd 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -625,44 +625,19 @@ void MainWindow::updateDockActionsChecked() } } -void MainWindow::showDefaultDocks() -{ - const QList defaultDocks = { sectionsDock, - entrypointDock, - functionsDock, - commentsDock, - stringsDock, - consoleDock, - importsDock, - symbolsDock, - graphDock, - disassemblyDock, - sidebarDock, - hexdumpDock, - pseudocodeDock, - dashboardDock, -#ifdef CUTTER_ENABLE_JUPYTER - jupyterDock -#endif - }; - - for (auto w : dockWidgets) { - if (defaultDocks.contains(w)) { - w->show(); - } - } - - updateDockActionsChecked(); -} - void MainWindow::showZenDocks() { const QList zenDocks = { functionsDock, + dashboardDock, stringsDock, graphDock, disassemblyDock, hexdumpDock, - searchDock + searchDock, + importsDock, +#ifdef CUTTER_ENABLE_JUPYTER + jupyterDock +#endif }; for (auto w : dockWidgets) { if (zenDocks.contains(w)) { @@ -698,35 +673,13 @@ void MainWindow::resetToDefaultLayout() { hideAllDocks(); restoreDocks(); - showDefaultDocks(); + showZenDocks(); dashboardDock->raise(); - // ugly workaround to set the default widths of functions and sidebar docks - // if anyone finds a way to do this cleaner that also works, feel free to change it! - auto restoreFunctionDock = qhelpers::forceWidth(functionsDock->widget(), 300); - auto restoreSidebarDock = qhelpers::forceWidth(sidebarDock->widget(), 300); - - qApp->processEvents(); - - restoreFunctionDock.restoreWidth(functionsDock->widget()); - restoreSidebarDock.restoreWidth(sidebarDock->widget()); - - core->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Disassembly); -} - -void MainWindow::resetToZenLayout() -{ - hideAllDocks(); - restoreDocks(); - showZenDocks(); - disassemblyDock->raise(); - - // ugly workaround to set the default widths of functions + // Ugly workaround to set the default widths of functions docks // if anyone finds a way to do this cleaner that also works, feel free to change it! auto restoreFunctionDock = qhelpers::forceWidth(functionsDock->widget(), 200); - qApp->processEvents(); - restoreFunctionDock.restoreWidth(functionsDock->widget()); core->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Disassembly); @@ -782,11 +735,6 @@ void MainWindow::on_actionDefault_triggered() resetToDefaultLayout(); } -void MainWindow::on_actionZen_triggered() -{ - resetToZenLayout(); -} - /** * @brief MainWindow::on_actionNew_triggered * Open a new Cutter session. diff --git a/src/MainWindow.h b/src/MainWindow.h index 32fd98f4..25a98c52 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -66,7 +66,7 @@ public: bool responsive; explicit MainWindow(QWidget *parent = nullptr); - ~MainWindow(); + ~MainWindow() override; void openNewFile(InitialOptions options = InitialOptions(), bool skipOptionsDialog = false); void displayNewFileDialog(); @@ -133,7 +133,6 @@ private slots: void on_actionDisasAdd_comment_triggered(); void on_actionDefault_triggered(); - void on_actionZen_triggered(); void on_actionFunctionsRename_triggered(); @@ -170,7 +169,7 @@ private slots: void updateTasksIndicator(); void mousePressEvent(QMouseEvent *event) override; - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(QObject *object, QEvent *event) override; void changeDebugView(); void changeDefinedView(); @@ -236,12 +235,10 @@ private: void displayInitialOptionsDialog(const InitialOptions &options = InitialOptions(), bool skipOptionsDialog = false); void resetToDefaultLayout(); - void resetToZenLayout(); void resetToDebugLayout(); void restoreDocks(); void hideAllDocks(); - void showDefaultDocks(); void showZenDocks(); void showDebugDocks(); void updateDockActionsChecked(); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 9e75fa49..97a0bf19 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -80,7 +80,7 @@ QToolTip { 0 0 1013 - 21 + 20 @@ -94,8 +94,8 @@ QToolTip { 378 100 - 136 - 271 + 151 + 240 @@ -125,7 +125,6 @@ QToolTip { -