Button "Stop using tool".

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-24 21:49:59 +03:00
parent 5679158b56
commit b4a0006835
3 changed files with 26 additions and 12 deletions

View File

@ -1018,6 +1018,7 @@ void MainWindow::CancelTool()
case Tool::Arrow:
ui->actionArrowTool->setChecked(false);
helpLabel->setText("");
ui->actionStopTool->setEnabled(true);
break;
case Tool::SinglePoint:
Q_UNREACHABLE();
@ -1145,6 +1146,7 @@ void MainWindow::ArrowTool()
{
CancelTool();
ui->actionArrowTool->setChecked(true);
ui->actionStopTool->setEnabled(false);
tool = Tool::Arrow;
QCursor cur(Qt::ArrowCursor);
ui->view->setCursor(cur);
@ -1152,15 +1154,6 @@ void MainWindow::ArrowTool()
ui->view->setShowToolOptions(true);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ActionAroowTool set arrow tool. Cansel tool what was before.
*/
void MainWindow::ActionAroowTool()
{
ArrowTool();
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief keyPressEvent handle key press events.
@ -2097,7 +2090,8 @@ void MainWindow::CreateActions()
{
ui->setupUi(this);
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
connect(ui->actionStopTool, &QAction::triggered, this, &MainWindow::ArrowTool);
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ArrowTool);
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewPP);

View File

@ -59,8 +59,8 @@ public:
void ReopenFilesAfterCrash();
public slots:
void mouseMove(const QPointF &scenePos);
void ArrowTool();
void ActionAroowTool();
void ActionDraw(bool checked);
void ActionDetails(bool checked);
void ActionNewPP();
@ -206,7 +206,6 @@ private:
void ToolBarTools();
void InitToolButtons();
void CancelTool();
void ArrowTool();
void SetEnableWidgets(bool enable);
void SetEnableTool(bool enable);
void SaveCurrentScene();

View File

@ -864,6 +864,9 @@
</attribute>
</widget>
<widget class="QToolBar" name="toolBarTools">
<property name="enabled">
<bool>true</bool>
</property>
<property name="windowTitle">
<string>Toolbar tools</string>
</property>
@ -877,6 +880,7 @@
<addaction name="actionZoomOut"/>
<addaction name="actionZoomOriginal"/>
<addaction name="actionZoomFitBest"/>
<addaction name="actionStopTool"/>
</widget>
<widget class="QDockWidget" name="dockWidgetToolOptions">
<property name="minimumSize">
@ -1217,6 +1221,23 @@
<string>Ctrl+=</string>
</property>
</action>
<action name="actionStopTool">
<property name="checkable">
<bool>false</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset theme="process-stop"/>
</property>
<property name="text">
<string>Stop</string>
</property>
<property name="toolTip">
<string>Stop using tool</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>