diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 9ef669c1b..f67d7ad0a 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -874,6 +874,20 @@ void MainWindow::ToolArc(bool checked) &MainWindow::ApplyDialog); } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ToolEllipticalArc handler tool arc. + * @param checked true - button checked. + */ +void MainWindow::ToolEllipticalArc(bool checked) +{ + ToolSelectPointByRelease(); + SetToolButtonWithApply(checked, Tool::EllipticalArc, ":/cursor/el_arc_cursor.png", + tr("Select point of center of elliptical arc"), + &MainWindow::ClosedDialogWithApply, + &MainWindow::ApplyDialog); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ToolSplinePath handler tool splinePath. @@ -1698,6 +1712,7 @@ void MainWindow::InitToolButtons() toolButtonPointerList.append(ui->toolButtonPointerArc); toolButtonPointerList.append(ui->toolButtonPointerDetail); toolButtonPointerList.append(ui->toolButtonPointerOperations); + toolButtonPointerList.append(ui->toolButtonPointerEllipticalArc); for (auto pointer : toolButtonPointerList) { @@ -1746,6 +1761,7 @@ void MainWindow::InitToolButtons() connect(ui->toolButtonMove, &QToolButton::clicked, this, &MainWindow::ToolMove); connect(ui->toolButtonMidpoint, &QToolButton::clicked, this, &MainWindow::ToolMidpoint); connect(ui->toolButtonLayoutExportAs, &QToolButton::clicked, this, &MainWindow::ExportLayoutAs); + connect(ui->toolButtonEllipticalArc, &QToolButton::clicked, this, &MainWindow::ToolEllipticalArc); } //--------------------------------------------------------------------------------------------------------------------- @@ -1773,7 +1789,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") void MainWindow::CancelTool() { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was handled."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was handled."); qCDebug(vMainWindow, "Canceling tool."); delete dialogTool; @@ -1922,6 +1938,9 @@ void MainWindow::CancelTool() case Tool::Move: ui->toolButtonMove->setChecked(false); break; + case Tool::EllipticalArc: + ui->toolButtonEllipticalArc->setChecked(false); + break; } // Crash: using CRTL+Z while using line tool. @@ -2972,7 +2991,7 @@ void MainWindow::SetEnableTool(bool enable) } // This check helps to find missed tools - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools were handled."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools were handled."); //Drawing Tools ui->toolButtonEndLine->setEnabled(drawTools); @@ -3011,6 +3030,7 @@ void MainWindow::SetEnableTool(bool enable) ui->toolButtonFlippingByAxis->setEnabled(drawTools); ui->toolButtonMove->setEnabled(drawTools); ui->toolButtonMidpoint->setEnabled(drawTools); + ui->toolButtonEllipticalArc->setEnabled(drawTools); ui->actionLast_tool->setEnabled(drawTools); @@ -3292,7 +3312,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") void MainWindow::LastUsedTool() { // This check helps to find missed tools in the switch - Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was handled."); + Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was handled."); if (currentTool == lastUsedTool) { @@ -3470,6 +3490,10 @@ void MainWindow::LastUsedTool() ui->toolButtonMove->setChecked(true); ToolMove(true); break; + case Tool::EllipticalArc: + ui->toolButtonEllipticalArc->setChecked(true); + ToolEllipticalArc(true); + break; } } diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 8bc530b0c..1739fdd9c 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -129,6 +129,7 @@ private slots: void ToolCubicBezier(bool checked); void ToolCutSpline(bool checked); void ToolArc(bool checked); + void ToolEllipticalArc(bool checked); void ToolSplinePath(bool checked); void ToolCubicBezierPath(bool checked); void ToolCutSplinePath(bool checked); diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index 27f576e5e..0b44070b6 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -1058,6 +1058,86 @@ + + + + 0 + 0 + 130 + 56 + + + + + 0 + 0 + + + + Tools for creating elliptical arcs. + + + + :/icon/16x16/toolsectionelarc@2x.png:/icon/16x16/toolsectionelarc@2x.png + + + Elliptical Arc + + + + + + false + + + Tool pointer + + + ... + + + + :/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png + + + + 32 + 32 + + + + true + + + + + + + false + + + Arc + + + ... + + + + :/toolicon/32x32/el_arc.png:/toolicon/32x32/el_arc.png + + + + 32 + 32 + + + + true + + + + + diff --git a/src/app/valentina/share/resources/cursor.qrc b/src/app/valentina/share/resources/cursor.qrc index b2631218b..e92f24e13 100644 --- a/src/app/valentina/share/resources/cursor.qrc +++ b/src/app/valentina/share/resources/cursor.qrc @@ -76,5 +76,7 @@ cursor/flipping_axis_cursor@2x.png cursor/move_cursor.png cursor/move_cursor@2x.png + cursor/el_arc_cursor.png + cursor/el_arc_cursor@2x.png diff --git a/src/app/valentina/share/resources/cursor/el_arc_cursor.png b/src/app/valentina/share/resources/cursor/el_arc_cursor.png new file mode 100644 index 000000000..03b9d0ef5 Binary files /dev/null and b/src/app/valentina/share/resources/cursor/el_arc_cursor.png differ diff --git a/src/app/valentina/share/resources/cursor/el_arc_cursor@2x.png b/src/app/valentina/share/resources/cursor/el_arc_cursor@2x.png new file mode 100644 index 000000000..32949c8e2 Binary files /dev/null and b/src/app/valentina/share/resources/cursor/el_arc_cursor@2x.png differ diff --git a/src/app/valentina/share/resources/toolicon.qrc b/src/app/valentina/share/resources/toolicon.qrc index 675a47d40..41de1c552 100644 --- a/src/app/valentina/share/resources/toolicon.qrc +++ b/src/app/valentina/share/resources/toolicon.qrc @@ -74,5 +74,7 @@ toolicon/32x32/flipping_axis@2x.png toolicon/32x32/move.png toolicon/32x32/move@2x.png + toolicon/32x32/el_arc.png + toolicon/32x32/el_arc@2x.png diff --git a/src/app/valentina/share/resources/toolicon/32x32/el_arc.png b/src/app/valentina/share/resources/toolicon/32x32/el_arc.png new file mode 100644 index 000000000..d2af0b2c4 Binary files /dev/null and b/src/app/valentina/share/resources/toolicon/32x32/el_arc.png differ diff --git a/src/app/valentina/share/resources/toolicon/32x32/el_arc@2x.png b/src/app/valentina/share/resources/toolicon/32x32/el_arc@2x.png new file mode 100644 index 000000000..e5c97ba7b Binary files /dev/null and b/src/app/valentina/share/resources/toolicon/32x32/el_arc@2x.png differ diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index c7ed109f2..05076bd9f 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1422,7 +1422,7 @@ QStringList VAbstractPattern::ListPointExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49); QStringList expressions; const QDomNodeList list = elementsByTagName(TagPoint); @@ -1493,7 +1493,7 @@ QStringList VAbstractPattern::ListArcExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49); QStringList expressions; const QDomNodeList list = elementsByTagName(TagArc); @@ -1554,7 +1554,7 @@ QStringList VAbstractPattern::ListPathPointExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49); QStringList expressions; const QDomNodeList list = elementsByTagName(AttrPathPoint); @@ -1620,7 +1620,7 @@ QStringList VAbstractPattern::ListOperationExpressions() const { // Check if new tool doesn't bring new attribute with a formula. // If no just increment number - Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 48); + Q_STATIC_ASSERT(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 49); QStringList expressions; const QDomNodeList list = elementsByTagName(TagOperation); diff --git a/src/libs/vmisc/share/resources/icon.qrc b/src/libs/vmisc/share/resources/icon.qrc index ee4e61b21..012520e8b 100644 --- a/src/libs/vmisc/share/resources/icon.qrc +++ b/src/libs/vmisc/share/resources/icon.qrc @@ -64,5 +64,7 @@ icon/16x16/allow_detail@2x.png icon/16x16/forbid_detail.png icon/16x16/forbid_detail@2x.png + icon/16x16/toolsectionelarc.png + icon/16x16/toolsectionelarc@2x.png diff --git a/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc.png b/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc.png new file mode 100644 index 000000000..2178c0aab Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc.png differ diff --git a/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc@2x.png b/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc@2x.png new file mode 100644 index 000000000..2f66ae8b3 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/16x16/toolsectionelarc@2x.png differ