From bc97dc7855dfac3481d87841f07d2749e5bc2091 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 12 Jan 2014 22:04:15 +0200 Subject: [PATCH] Set enabled for tool button in different mode. --HG-- branch : feature --- src/mainwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5eaa9a3e6..e9c70baf0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -701,6 +701,7 @@ void MainWindow::ToolBarDraws() ui->toolBarDraws->addAction(ui->actionLayout); connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout); + ui->actionLayout->setEnabled(false); } void MainWindow::currentDrawChanged( int index ) @@ -928,6 +929,11 @@ void MainWindow::ActionDraw(bool checked) SetEnableTool(true); doc->setCurrentData(); ui->toolBox->setCurrentIndex(currentToolBoxIndex); + + ui->actionHistory->setEnabled(true); + ui->actionLayout->setEnabled(false); + ui->actionOptionDraw->setEnabled(true); + ui->actionNewDraw->setEnabled(true); } else { @@ -956,6 +962,11 @@ void MainWindow::ActionDetails(bool checked) SetEnableTool(true); currentToolBoxIndex = ui->toolBox->currentIndex(); ui->toolBox->setCurrentIndex(4); + + ui->actionHistory->setEnabled(false); + ui->actionLayout->setEnabled(true); + ui->actionOptionDraw->setEnabled(false); + ui->actionNewDraw->setEnabled(false); } else {