New option: Use Tool Groups.
This commit is contained in:
parent
812c0b84d7
commit
f3538df445
|
@ -38,6 +38,7 @@
|
||||||
- Fix issue with passing incorrect number of dimension to Tape.
|
- Fix issue with passing incorrect number of dimension to Tape.
|
||||||
- New option: Pointer mode.
|
- New option: Pointer mode.
|
||||||
- Fix GUI freezing while nesting.
|
- Fix GUI freezing while nesting.
|
||||||
|
- New option: Use Tool Groups.
|
||||||
|
|
||||||
# Valentina 0.7.52 September 12, 2022
|
# Valentina 0.7.52 September 12, 2022
|
||||||
- Fix crash when default locale is ru.
|
- Fix crash when default locale is ru.
|
||||||
|
|
|
@ -151,6 +151,9 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
|
||||||
ui->comboBoxPointerMode->setCurrentIndex(index);
|
ui->comboBoxPointerMode->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use tool groups
|
||||||
|
ui->checkBoxUseToolGroups->setChecked(settings->IsUseToolGroups());
|
||||||
|
|
||||||
// Native dialogs
|
// Native dialogs
|
||||||
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
|
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
|
||||||
|
|
||||||
|
@ -234,6 +237,11 @@ auto PreferencesConfigurationPage::Apply() -> QStringList
|
||||||
|
|
||||||
settings->SetPointerMode(static_cast<VToolPointerMode>(ui->comboBoxPointerMode->currentData().toInt()));
|
settings->SetPointerMode(static_cast<VToolPointerMode>(ui->comboBoxPointerMode->currentData().toInt()));
|
||||||
|
|
||||||
|
if (settings->IsUseToolGroups() != ui->checkBoxUseToolGroups->isChecked())
|
||||||
|
{
|
||||||
|
settings->SetUseToolGroups(ui->checkBoxUseToolGroups->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
|
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
|
||||||
{
|
{
|
||||||
settings->SetDontUseNativeDialog(ui->checkBoxDontUseNativeDialog->isChecked());
|
settings->SetDontUseNativeDialog(ui->checkBoxDontUseNativeDialog->isChecked());
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-101</y>
|
<y>-134</y>
|
||||||
<width>624</width>
|
<width>624</width>
|
||||||
<height>937</height>
|
<height>966</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
@ -385,6 +385,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxUseToolGroups">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use tool groups</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
|
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
|
@ -3041,186 +3041,288 @@ void MainWindow::ToolBarDrawTools()
|
||||||
{
|
{
|
||||||
SetupDrawToolsIcons();
|
SetupDrawToolsIcons();
|
||||||
|
|
||||||
// Point tools
|
VValentinaSettings *settings = VApplication::VApp()->ValentinaSettings();
|
||||||
|
|
||||||
|
ui->toolBarPointTools->clear();
|
||||||
|
if (settings->IsUseToolGroups())
|
||||||
{
|
{
|
||||||
auto *linePointToolMenu = new QMenu(this);
|
// Point tools
|
||||||
linePointToolMenu->addAction(ui->actionEndLineTool);
|
{
|
||||||
linePointToolMenu->addAction(ui->actionAlongLineTool);
|
auto *linePointToolMenu = new QMenu(this);
|
||||||
linePointToolMenu->addAction(ui->actionMidpointTool);
|
linePointToolMenu->addAction(ui->actionEndLineTool);
|
||||||
|
linePointToolMenu->addAction(ui->actionAlongLineTool);
|
||||||
|
linePointToolMenu->addAction(ui->actionMidpointTool);
|
||||||
|
|
||||||
auto *linePointTool = new VToolButtonPopup(this);
|
auto *linePointTool = new VToolButtonPopup(this);
|
||||||
linePointTool->setMenu(linePointToolMenu);
|
linePointTool->setMenu(linePointToolMenu);
|
||||||
linePointTool->setDefaultAction(ui->actionEndLineTool);
|
linePointTool->setDefaultAction(ui->actionEndLineTool);
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(linePointTool);
|
ui->toolBarPointTools->addWidget(linePointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *angleLinePointToolMenu = new QMenu(this);
|
||||||
|
angleLinePointToolMenu->addAction(ui->actionNormalTool);
|
||||||
|
angleLinePointToolMenu->addAction(ui->actionBisectorTool);
|
||||||
|
angleLinePointToolMenu->addAction(ui->actionHeightTool);
|
||||||
|
|
||||||
|
auto *angleLinePointTool = new VToolButtonPopup(this);
|
||||||
|
angleLinePointTool->setMenu(angleLinePointToolMenu);
|
||||||
|
angleLinePointTool->setDefaultAction(ui->actionNormalTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(angleLinePointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *lineIntersectionPointToolMenu = new QMenu(this);
|
||||||
|
lineIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionTool);
|
||||||
|
lineIntersectionPointToolMenu->addAction(ui->actionLineIntersectTool);
|
||||||
|
|
||||||
|
auto *lineIntersectionPointTool = new VToolButtonPopup(this);
|
||||||
|
lineIntersectionPointTool->setMenu(lineIntersectionPointToolMenu);
|
||||||
|
lineIntersectionPointTool->setDefaultAction(ui->actionPointOfIntersectionTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(lineIntersectionPointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *specialPointToolMenu = new QMenu(this);
|
||||||
|
specialPointToolMenu->addAction(ui->actionShoulderPointTool);
|
||||||
|
specialPointToolMenu->addAction(ui->actionTriangleTool);
|
||||||
|
|
||||||
|
auto *specialPointTool = new VToolButtonPopup(this);
|
||||||
|
specialPointTool->setMenu(specialPointToolMenu);
|
||||||
|
specialPointTool->setDefaultAction(ui->actionShoulderPointTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(specialPointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *axisPointToolMenu = new QMenu(this);
|
||||||
|
axisPointToolMenu->addAction(ui->actionLineIntersectAxisTool);
|
||||||
|
axisPointToolMenu->addAction(ui->actionCurveIntersectAxisTool);
|
||||||
|
axisPointToolMenu->addAction(ui->actionArcIntersectAxisTool);
|
||||||
|
|
||||||
|
auto *axisPointTool = new VToolButtonPopup(this);
|
||||||
|
axisPointTool->setMenu(axisPointToolMenu);
|
||||||
|
axisPointTool->setDefaultAction(ui->actionLineIntersectAxisTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(axisPointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *curveSegmentPointToolMenu = new QMenu(this);
|
||||||
|
curveSegmentPointToolMenu->addAction(ui->actionSplineCutPointTool);
|
||||||
|
curveSegmentPointToolMenu->addAction(ui->actionSplinePathCutPointTool);
|
||||||
|
curveSegmentPointToolMenu->addAction(ui->actionArcCutPointTool);
|
||||||
|
|
||||||
|
auto *curveSegmentPointTool = new VToolButtonPopup(this);
|
||||||
|
curveSegmentPointTool->setMenu(curveSegmentPointToolMenu);
|
||||||
|
curveSegmentPointTool->setDefaultAction(ui->actionSplineCutPointTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(curveSegmentPointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *curveIntersectionPointToolMenu = new QMenu(this);
|
||||||
|
curveIntersectionPointToolMenu->addAction(ui->actionIntersectionCurvesTool);
|
||||||
|
curveIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionArcsTool);
|
||||||
|
curveIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionCirclesTool);
|
||||||
|
|
||||||
|
auto *curveIntersectionPointTool = new VToolButtonPopup(this);
|
||||||
|
curveIntersectionPointTool->setMenu(curveIntersectionPointToolMenu);
|
||||||
|
curveIntersectionPointTool->setDefaultAction(ui->actionIntersectionCurvesTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(curveIntersectionPointTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *tangentPointToolMenu = new QMenu(this);
|
||||||
|
tangentPointToolMenu->addAction(ui->actionPointFromArcAndTangentTool);
|
||||||
|
tangentPointToolMenu->addAction(ui->actionPointFromCircleAndTangentTool);
|
||||||
|
tangentPointToolMenu->addAction(ui->actionPointOfContactTool);
|
||||||
|
|
||||||
|
auto *tangentPointTool = new VToolButtonPopup(this);
|
||||||
|
tangentPointTool->setMenu(tangentPointToolMenu);
|
||||||
|
tangentPointTool->setDefaultAction(ui->actionPointFromArcAndTangentTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addWidget(tangentPointTool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionEndLineTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionAlongLineTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionMidpointTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionNormalTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionBisectorTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionHeightTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointOfIntersectionTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionLineIntersectTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionShoulderPointTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionTriangleTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionLineIntersectAxisTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionCurveIntersectAxisTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionArcIntersectAxisTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionSplineCutPointTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionSplinePathCutPointTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionArcCutPointTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionIntersectionCurvesTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointOfIntersectionArcsTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointOfIntersectionCirclesTool);
|
||||||
|
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointFromArcAndTangentTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointFromCircleAndTangentTool);
|
||||||
|
ui->toolBarPointTools->addAction(ui->actionPointOfContactTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->toolBarCurveTools->clear();
|
||||||
|
if (settings->IsUseToolGroups())
|
||||||
{
|
{
|
||||||
auto *angleLinePointToolMenu = new QMenu(this);
|
// Curve tools
|
||||||
angleLinePointToolMenu->addAction(ui->actionNormalTool);
|
{
|
||||||
angleLinePointToolMenu->addAction(ui->actionBisectorTool);
|
auto *curveToolMenu = new QMenu(this);
|
||||||
angleLinePointToolMenu->addAction(ui->actionHeightTool);
|
curveToolMenu->addAction(ui->actionSplineTool);
|
||||||
|
curveToolMenu->addAction(ui->actionCubicBezierTool);
|
||||||
|
curveToolMenu->addAction(ui->actionSplinePathTool);
|
||||||
|
curveToolMenu->addAction(ui->actionCubicBezierPathTool);
|
||||||
|
curveToolMenu->addAction(ui->actionArcTool);
|
||||||
|
curveToolMenu->addAction(ui->actionArcWithLengthTool);
|
||||||
|
curveToolMenu->addAction(ui->actionEllipticalArcTool);
|
||||||
|
|
||||||
auto *angleLinePointTool = new VToolButtonPopup(this);
|
auto *curvePointTool = new VToolButtonPopup(this);
|
||||||
angleLinePointTool->setMenu(angleLinePointToolMenu);
|
curvePointTool->setMenu(curveToolMenu);
|
||||||
angleLinePointTool->setDefaultAction(ui->actionNormalTool);
|
curvePointTool->setDefaultAction(ui->actionSplineTool);
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(angleLinePointTool);
|
ui->toolBarCurveTools->addWidget(curvePointTool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionSplineTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionCubicBezierTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionSplinePathTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionCubicBezierPathTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionArcTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionArcWithLengthTool);
|
||||||
|
ui->toolBarCurveTools->addAction(ui->actionEllipticalArcTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->clear();
|
||||||
|
if (settings->IsUseToolGroups())
|
||||||
{
|
{
|
||||||
auto *lineIntersectionPointToolMenu = new QMenu(this);
|
// Group tools
|
||||||
lineIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionTool);
|
ui->toolBarOperationTools->addAction(ui->actionGroupTool);
|
||||||
lineIntersectionPointToolMenu->addAction(ui->actionLineIntersectTool);
|
|
||||||
|
|
||||||
auto *lineIntersectionPointTool = new VToolButtonPopup(this);
|
{
|
||||||
lineIntersectionPointTool->setMenu(lineIntersectionPointToolMenu);
|
auto *symmetryToolMenu = new QMenu(this);
|
||||||
lineIntersectionPointTool->setDefaultAction(ui->actionPointOfIntersectionTool);
|
symmetryToolMenu->addAction(ui->actionFlippingByAxisTool);
|
||||||
|
symmetryToolMenu->addAction(ui->actionFlippingByLineTool);
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(lineIntersectionPointTool);
|
auto *symmetryTool = new VToolButtonPopup(this);
|
||||||
|
symmetryTool->setMenu(symmetryToolMenu);
|
||||||
|
symmetryTool->setDefaultAction(ui->actionFlippingByAxisTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addWidget(symmetryTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *symmetryToolMenu = new QMenu(this);
|
||||||
|
symmetryToolMenu->addAction(ui->actionFlippingByAxisTool);
|
||||||
|
symmetryToolMenu->addAction(ui->actionFlippingByLineTool);
|
||||||
|
|
||||||
|
auto *symmetryTool = new VToolButtonPopup(this);
|
||||||
|
symmetryTool->setMenu(symmetryToolMenu);
|
||||||
|
symmetryTool->setDefaultAction(ui->actionFlippingByAxisTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addWidget(symmetryTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *transformToolMenu = new QMenu(this);
|
||||||
|
transformToolMenu->addAction(ui->actionRotationTool);
|
||||||
|
transformToolMenu->addAction(ui->actionMoveTool);
|
||||||
|
|
||||||
|
auto *transformTool = new VToolButtonPopup(this);
|
||||||
|
transformTool->setMenu(transformToolMenu);
|
||||||
|
transformTool->setDefaultAction(ui->actionRotationTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addWidget(transformTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionTrueDartsTool);
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionExportDraw);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionGroupTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionFlippingByAxisTool);
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionFlippingByLineTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionFlippingByAxisTool);
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionFlippingByLineTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionRotationTool);
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionMoveTool);
|
||||||
|
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionTrueDartsTool);
|
||||||
|
ui->toolBarOperationTools->addAction(ui->actionExportDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->toolBarDetailTools->clear();
|
||||||
|
if (settings->IsUseToolGroups())
|
||||||
{
|
{
|
||||||
auto *specialPointToolMenu = new QMenu(this);
|
// Detail tools
|
||||||
specialPointToolMenu->addAction(ui->actionShoulderPointTool);
|
ui->toolBarDetailTools->addAction(ui->actionNewDetailTool);
|
||||||
specialPointToolMenu->addAction(ui->actionTriangleTool);
|
{
|
||||||
|
auto *detailToolMenu = new QMenu(this);
|
||||||
|
detailToolMenu->addAction(ui->actionUnionDetailsTool);
|
||||||
|
detailToolMenu->addAction(ui->actionDuplicateDetailTool);
|
||||||
|
|
||||||
auto *specialPointTool = new VToolButtonPopup(this);
|
auto *detailTool = new VToolButtonPopup(this);
|
||||||
specialPointTool->setMenu(specialPointToolMenu);
|
detailTool->setMenu(detailToolMenu);
|
||||||
specialPointTool->setDefaultAction(ui->actionShoulderPointTool);
|
detailTool->setDefaultAction(ui->actionUnionDetailsTool);
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(specialPointTool);
|
ui->toolBarDetailTools->addWidget(detailTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto *internalDetailItemToolMenu = new QMenu(this);
|
||||||
|
internalDetailItemToolMenu->addAction(ui->actionInternalPathTool);
|
||||||
|
internalDetailItemToolMenu->addAction(ui->actionPinTool);
|
||||||
|
internalDetailItemToolMenu->addAction(ui->actionInsertNodeTool);
|
||||||
|
internalDetailItemToolMenu->addAction(ui->actionPlaceLabelTool);
|
||||||
|
|
||||||
|
auto *detailTool = new VToolButtonPopup(this);
|
||||||
|
detailTool->setMenu(internalDetailItemToolMenu);
|
||||||
|
detailTool->setDefaultAction(ui->actionInternalPathTool);
|
||||||
|
|
||||||
|
ui->toolBarDetailTools->addWidget(detailTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->toolBarDetailTools->addAction(ui->actionDetailExportAs);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
auto *axisPointToolMenu = new QMenu(this);
|
ui->toolBarDetailTools->addAction(ui->actionNewDetailTool);
|
||||||
axisPointToolMenu->addAction(ui->actionLineIntersectAxisTool);
|
|
||||||
axisPointToolMenu->addAction(ui->actionCurveIntersectAxisTool);
|
|
||||||
axisPointToolMenu->addAction(ui->actionArcIntersectAxisTool);
|
|
||||||
|
|
||||||
auto *axisPointTool = new VToolButtonPopup(this);
|
ui->toolBarDetailTools->addAction(ui->actionUnionDetailsTool);
|
||||||
axisPointTool->setMenu(axisPointToolMenu);
|
ui->toolBarDetailTools->addAction(ui->actionDuplicateDetailTool);
|
||||||
axisPointTool->setDefaultAction(ui->actionLineIntersectAxisTool);
|
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(axisPointTool);
|
ui->toolBarDetailTools->addAction(ui->actionInternalPathTool);
|
||||||
|
ui->toolBarDetailTools->addAction(ui->actionPinTool);
|
||||||
|
ui->toolBarDetailTools->addAction(ui->actionInsertNodeTool);
|
||||||
|
ui->toolBarDetailTools->addAction(ui->actionPlaceLabelTool);
|
||||||
|
|
||||||
|
ui->toolBarDetailTools->addAction(ui->actionDetailExportAs);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
auto *curveSegmentPointToolMenu = new QMenu(this);
|
|
||||||
curveSegmentPointToolMenu->addAction(ui->actionSplineCutPointTool);
|
|
||||||
curveSegmentPointToolMenu->addAction(ui->actionSplinePathCutPointTool);
|
|
||||||
curveSegmentPointToolMenu->addAction(ui->actionArcCutPointTool);
|
|
||||||
|
|
||||||
auto *curveSegmentPointTool = new VToolButtonPopup(this);
|
|
||||||
curveSegmentPointTool->setMenu(curveSegmentPointToolMenu);
|
|
||||||
curveSegmentPointTool->setDefaultAction(ui->actionSplineCutPointTool);
|
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(curveSegmentPointTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto *curveIntersectionPointToolMenu = new QMenu(this);
|
|
||||||
curveIntersectionPointToolMenu->addAction(ui->actionIntersectionCurvesTool);
|
|
||||||
curveIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionArcsTool);
|
|
||||||
curveIntersectionPointToolMenu->addAction(ui->actionPointOfIntersectionCirclesTool);
|
|
||||||
|
|
||||||
auto *curveIntersectionPointTool = new VToolButtonPopup(this);
|
|
||||||
curveIntersectionPointTool->setMenu(curveIntersectionPointToolMenu);
|
|
||||||
curveIntersectionPointTool->setDefaultAction(ui->actionIntersectionCurvesTool);
|
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(curveIntersectionPointTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto *tangentPointToolMenu = new QMenu(this);
|
|
||||||
tangentPointToolMenu->addAction(ui->actionPointFromArcAndTangentTool);
|
|
||||||
tangentPointToolMenu->addAction(ui->actionPointFromCircleAndTangentTool);
|
|
||||||
tangentPointToolMenu->addAction(ui->actionPointOfContactTool);
|
|
||||||
|
|
||||||
auto *tangentPointTool = new VToolButtonPopup(this);
|
|
||||||
tangentPointTool->setMenu(tangentPointToolMenu);
|
|
||||||
tangentPointTool->setDefaultAction(ui->actionPointFromArcAndTangentTool);
|
|
||||||
|
|
||||||
ui->toolBarPointTools->addWidget(tangentPointTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Curve tools
|
|
||||||
{
|
|
||||||
auto *curveToolMenu = new QMenu(this);
|
|
||||||
curveToolMenu->addAction(ui->actionSplineTool);
|
|
||||||
curveToolMenu->addAction(ui->actionCubicBezierTool);
|
|
||||||
curveToolMenu->addAction(ui->actionSplinePathTool);
|
|
||||||
curveToolMenu->addAction(ui->actionCubicBezierPathTool);
|
|
||||||
curveToolMenu->addAction(ui->actionArcTool);
|
|
||||||
curveToolMenu->addAction(ui->actionArcWithLengthTool);
|
|
||||||
curveToolMenu->addAction(ui->actionEllipticalArcTool);
|
|
||||||
|
|
||||||
auto *curvePointTool = new VToolButtonPopup(this);
|
|
||||||
curvePointTool->setMenu(curveToolMenu);
|
|
||||||
curvePointTool->setDefaultAction(ui->actionSplineTool);
|
|
||||||
|
|
||||||
ui->toolBarCurveTools->addWidget(curvePointTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Group tools
|
|
||||||
ui->toolBarOperationTools->addAction(ui->actionGroupTool);
|
|
||||||
|
|
||||||
{
|
|
||||||
auto *symmetryToolMenu = new QMenu(this);
|
|
||||||
symmetryToolMenu->addAction(ui->actionFlippingByAxisTool);
|
|
||||||
symmetryToolMenu->addAction(ui->actionFlippingByLineTool);
|
|
||||||
|
|
||||||
auto *symmetryTool = new VToolButtonPopup(this);
|
|
||||||
symmetryTool->setMenu(symmetryToolMenu);
|
|
||||||
symmetryTool->setDefaultAction(ui->actionFlippingByAxisTool);
|
|
||||||
|
|
||||||
ui->toolBarOperationTools->addWidget(symmetryTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto *transformToolMenu = new QMenu(this);
|
|
||||||
transformToolMenu->addAction(ui->actionRotationTool);
|
|
||||||
transformToolMenu->addAction(ui->actionMoveTool);
|
|
||||||
|
|
||||||
auto *transformTool = new VToolButtonPopup(this);
|
|
||||||
transformTool->setMenu(transformToolMenu);
|
|
||||||
transformTool->setDefaultAction(ui->actionRotationTool);
|
|
||||||
|
|
||||||
ui->toolBarOperationTools->addWidget(transformTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->toolBarOperationTools->addAction(ui->actionTrueDartsTool);
|
|
||||||
ui->toolBarOperationTools->addAction(ui->actionExportDraw);
|
|
||||||
|
|
||||||
// Detail tools
|
|
||||||
ui->toolBarDetailTools->addAction(ui->actionNewDetailTool);
|
|
||||||
{
|
|
||||||
auto *detailToolMenu = new QMenu(this);
|
|
||||||
detailToolMenu->addAction(ui->actionUnionDetailsTool);
|
|
||||||
detailToolMenu->addAction(ui->actionDuplicateDetailTool);
|
|
||||||
|
|
||||||
auto *detailTool = new VToolButtonPopup(this);
|
|
||||||
detailTool->setMenu(detailToolMenu);
|
|
||||||
detailTool->setDefaultAction(ui->actionUnionDetailsTool);
|
|
||||||
|
|
||||||
ui->toolBarDetailTools->addWidget(detailTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto *internalDetailItemToolMenu = new QMenu(this);
|
|
||||||
internalDetailItemToolMenu->addAction(ui->actionInternalPathTool);
|
|
||||||
internalDetailItemToolMenu->addAction(ui->actionPinTool);
|
|
||||||
internalDetailItemToolMenu->addAction(ui->actionInsertNodeTool);
|
|
||||||
internalDetailItemToolMenu->addAction(ui->actionPlaceLabelTool);
|
|
||||||
|
|
||||||
auto *detailTool = new VToolButtonPopup(this);
|
|
||||||
detailTool->setMenu(internalDetailItemToolMenu);
|
|
||||||
detailTool->setDefaultAction(ui->actionInternalPathTool);
|
|
||||||
|
|
||||||
ui->toolBarDetailTools->addWidget(detailTool);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->toolBarDetailTools->addAction(ui->actionDetailExportAs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -3497,6 +3599,9 @@ void MainWindow::SetupDrawToolsIcons()
|
||||||
{
|
{
|
||||||
const QString resource = QStringLiteral("toolicon");
|
const QString resource = QStringLiteral("toolicon");
|
||||||
|
|
||||||
|
// This check helps to find missed tools
|
||||||
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 59, "Not all tools were handled.");
|
||||||
|
|
||||||
ui->actionLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("line.png")));
|
ui->actionLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("line.png")));
|
||||||
ui->actionEndLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("segment.png")));
|
ui->actionEndLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("segment.png")));
|
||||||
ui->actionAlongLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("along_line.png")));
|
ui->actionAlongLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("along_line.png")));
|
||||||
|
@ -6480,6 +6585,7 @@ void MainWindow::Preferences()
|
||||||
&VToolOptionsPropertyBrowser::RefreshOptions);
|
&VToolOptionsPropertyBrowser::RefreshOptions);
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarStyles);
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarStyles);
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolboxIconSize);
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolboxIconSize);
|
||||||
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarDrawTools);
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, [this]() { emit doc->FullUpdateFromFile(); });
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, [this]() { emit doc->FullUpdateFromFile(); });
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, ui->view,
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, ui->view,
|
||||||
&VMainGraphicsView::ResetScrollingAnimation);
|
&VMainGraphicsView::ResetScrollingAnimation);
|
||||||
|
|
|
@ -59,6 +59,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationLabelLanguage,
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationToolPointerMode,
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationToolPointerMode,
|
||||||
(QLatin1String("configuration/toolPointerMode")))
|
(QLatin1String("configuration/toolPointerMode")))
|
||||||
// NOLINTNEXTLINE
|
// NOLINTNEXTLINE
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationUseToolGroups,
|
||||||
|
(QLatin1String("configuration/useToolGroups")))
|
||||||
|
// NOLINTNEXTLINE
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutoRefreshPatternMessage,
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutoRefreshPatternMessage,
|
||||||
(QLatin1String("configuration/autoRefreshPatternMessage")))
|
(QLatin1String("configuration/autoRefreshPatternMessage")))
|
||||||
|
|
||||||
|
@ -1056,6 +1059,18 @@ void VValentinaSettings::SetPointerMode(VToolPointerMode mode)
|
||||||
setValue(*settingConfigurationToolPointerMode, static_cast<int>(mode));
|
setValue(*settingConfigurationToolPointerMode, static_cast<int>(mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
auto VValentinaSettings::IsUseToolGroups() const -> bool
|
||||||
|
{
|
||||||
|
return value(*settingConfigurationUseToolGroups, true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VValentinaSettings::SetUseToolGroups(bool value)
|
||||||
|
{
|
||||||
|
setValue(*settingConfigurationUseToolGroups, value);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto VValentinaSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const -> T
|
auto VValentinaSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const -> T
|
||||||
|
|
|
@ -251,6 +251,9 @@ public:
|
||||||
auto GetPointerMode() const -> VToolPointerMode;
|
auto GetPointerMode() const -> VToolPointerMode;
|
||||||
void SetPointerMode(VToolPointerMode mode);
|
void SetPointerMode(VToolPointerMode mode);
|
||||||
|
|
||||||
|
auto IsUseToolGroups() const -> bool;
|
||||||
|
void SetUseToolGroups(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY_MOVE(VValentinaSettings) // NOLINT
|
Q_DISABLE_COPY_MOVE(VValentinaSettings) // NOLINT
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user