Color debug toolbar when debugging (#545)

This commit is contained in:
fcasal 2018-06-22 09:46:23 +01:00 committed by xarkes
parent fc94b896c4
commit 1f49440c02
2 changed files with 12 additions and 0 deletions

View File

@ -48,8 +48,10 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
addAction(actionStepOver);
connect(actionStop, &QAction::triggered, Core(), &CutterCore::stopDebug);
connect(actionStop, &QAction::triggered, [=](){ this->colorToolbar(false); });
connect(actionStep, &QAction::triggered, Core(), &CutterCore::stepDebug);
connect(actionStart, &QAction::triggered, Core(), &CutterCore::startDebug);
connect(actionStart, &QAction::triggered, [=](){ this->colorToolbar(true); });
connect(actionStepOver, &QAction::triggered, Core(), &CutterCore::stepOverDebug);
connect(actionContinue, &QAction::triggered, Core(), &CutterCore::continueDebug);
connect(actionContinueUntilMain, &QAction::triggered, this, &DebugToolbar::continueUntilMain);
@ -60,4 +62,13 @@ DebugToolbar::DebugToolbar(MainWindow *main, QWidget *parent) :
void DebugToolbar::continueUntilMain()
{
Core()->continueUntilDebug(tr("main"));
}
void DebugToolbar::colorToolbar(bool p)
{
if (p) {
this->setStyleSheet("QToolBar {background: green;}");
} else {
this->setStyleSheet("");
}
}

View File

@ -17,5 +17,6 @@ private:
private slots:
void continueUntilMain();
void colorToolbar(bool p);
};