Commits

Andrew Fenn committed 68c6be9

Select tool can no longer be deselected
Deselecting brush, scale, rotation and move tools now automatically defaults to the select tool

  • Participants
  • Parent commits 5612930

Comments (0)

Files changed (1)

File qtOgitor/src/mainwindowactions.cpp

 //------------------------------------------------------------------------------
 void MainWindow::setToolSelect()
 {
+    if (!actSelect->isChecked()) {
+        actSelect->setChecked(true);
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_SELECT);
 //------------------------------------------------------------------------------
 void MainWindow::setToolMove()
 {
+    if (!actMove->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_MOVE);
 //------------------------------------------------------------------------------
 void MainWindow::setToolRotate()
 {
+    if (!actRotate->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_ROTATE);
 //------------------------------------------------------------------------------
 void MainWindow::setToolScale()
 {
+    if (!actScale->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_SCALE);
 //------------------------------------------------------------------------------
 void MainWindow::setToolDeform()
 {
+    if (!actDeform->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_DEFORM);
 //------------------------------------------------------------------------------
 void MainWindow::setToolSmooth()
 {
+    if (!actSmooth->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_SMOOTH);
 //------------------------------------------------------------------------------
 void MainWindow::setToolSplat()
 {
+    if (!actSplat->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_SPLAT);
 //------------------------------------------------------------------------------
 void MainWindow::setToolSplatGrass()
 {
+    if (!actSplatGrass->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_SPLATGRASS);
 //------------------------------------------------------------------------------
 void MainWindow::setToolPaint()
 {
+    if (!actPaint->isChecked()) {
+        setToolSelect();
+        return;
+    }
     CViewportEditor *vpe = OgitorsRoot::getSingletonPtr()->GetViewport();
     if(vpe)
         vpe->SetEditorTool(TOOL_PAINT);