This commit is contained in:
fcasal 2019-01-14 08:17:10 +00:00 committed by xarkes
parent d05fdd3d44
commit 7f80f96c55
2 changed files with 22 additions and 2 deletions

View File

@ -578,6 +578,7 @@ void MainWindow::restoreDocks()
tabifyDockWidget(dashboardDock, vTablesDock);
// Add Stack, Registers and Backtrace vertically stacked
addDockWidget(Qt::TopDockWidgetArea, stackDock);
splitDockWidget(stackDock, registersDock, Qt::Vertical);
tabifyDockWidget(stackDock, backtraceDock);
// MemoryMap/Breakpoint/RegRefs widget goes in the center tabs
@ -679,6 +680,19 @@ void MainWindow::resetToDefaultLayout()
}
void MainWindow::resetToDebugLayout()
{
CutterCore::MemoryWidgetType memType = core->getMemoryWidgetPriority();
hideAllDocks();
restoreDocks();
showDebugDocks();
core->raisePrioritizedMemoryWidget(memType);
auto restoreStackDock = qhelpers::forceWidth(stackDock->widget(), 400);
qApp->processEvents();
restoreStackDock.restoreWidth(stackDock->widget());
}
void MainWindow::restoreDebugLayout()
{
CutterCore::MemoryWidgetType memType = core->getMemoryWidgetPriority();
bool isMaxim = isMaximized();
@ -725,9 +739,14 @@ void MainWindow::on_actionFunctionsRename_triggered()
void MainWindow::on_actionDefault_triggered()
{
if (core->currentlyDebugging) {
resetToDebugLayout();
} else {
resetToDefaultLayout();
}
}
/**
* @brief MainWindow::on_actionNew_triggered
* Open a new Cutter session.
@ -944,7 +963,7 @@ void MainWindow::projectSaved(bool successfully, const QString &name)
void MainWindow::changeDebugView()
{
saveSettings();
resetToDebugLayout();
restoreDebugLayout();
enableDebugWidgetsMenu(true);
}

View File

@ -238,6 +238,7 @@ private:
void resetToDefaultLayout();
void resetToDebugLayout();
void restoreDebugLayout();
void restoreDocks();
void hideAllDocks();