diff --git a/ChangeLog.txt b/ChangeLog.txt index ce7443c99..00d80ba7a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,6 +8,7 @@ - Improve segmenting a curve for calculating a piece path. - [smart-pattern/valentina#184] Fix incorrect seam allowance. - Export area of piece in Final measurements. +- New option Show accuracy radius. # Valentina 0.7.52 September 12, 2022 - Fix crash when default locale is ru. diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 089c4d5f2..010b3c11a 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4021,6 +4021,7 @@ void MainWindow::Clear() ui->actionFinalMeasurements->setEnabled(false); ui->actionLast_tool->setEnabled(false); ui->actionShowCurveDetails->setEnabled(false); + ui->actionShowAccuracyRadius->setEnabled(false); ui->actionShowMainPath->setEnabled(false); ui->actionLoadIndividual->setEnabled(false); ui->actionLoadMultisize->setEnabled(false); @@ -4272,6 +4273,7 @@ void MainWindow::SetEnableWidgets(bool enable) ui->actionZoomFitBestCurrent->setEnabled(enableOnDrawStage); ui->actionZoomOriginal->setEnabled(enable); ui->actionShowCurveDetails->setEnabled(enableOnDrawStage); + ui->actionShowAccuracyRadius->setEnabled(enableOnDesignStage); ui->actionShowMainPath->setEnabled(enableOnDetailsStage); ui->actionLoadIndividual->setEnabled(enableOnDesignStage); ui->actionLoadMultisize->setEnabled(enableOnDesignStage); @@ -5656,6 +5658,15 @@ void MainWindow::CreateActions() VAbstractValApplication::VApp()->ValentinaSettings()->SetShowCurveDetails(checked); }); + ui->actionShowAccuracyRadius->setChecked( + VAbstractValApplication::VApp()->ValentinaSettings()->GetShowAccuracyRadius()); + connect(ui->actionShowAccuracyRadius, &QAction::triggered, this, [this](bool checked) + { + VAbstractValApplication::VApp()->ValentinaSettings()->SetShowAccuracyRadius(checked); + m_sceneDetails->update(); + m_sceneDraw->update(); + }); + ui->actionShowMainPath->setChecked(VAbstractValApplication::VApp()->ValentinaSettings()->IsPieceShowMainPath()); connect(ui->actionShowMainPath, &QAction::triggered, this, &MainWindow::ActionShowMainPath_triggered); diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index ca48c1d88..6570eccd3 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -1778,6 +1778,7 @@ + @@ -3182,6 +3183,17 @@ QAction::NoRole + + + true + + + false + + + Show accuracy radius + + diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 77ab543f9..e0abb860f 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -107,6 +107,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternShowCurveDetails, (QLatin Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternPieceShowMainPath, (QLatin1String("pattern/pieceShowMainPath"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternLabelFontSize, (QLatin1String("pattern/labelFontSize"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternHideLabels, (QLatin1String("pattern/hideLabels"))) // NOLINT +Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternShowAccuracyRadius, (QLatin1String("pattern/showAccuracyRadius"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternUseOpenGLRender, (QLatin1String("pattern/useOpenGLRender"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternGraphicalOutput, (QLatin1String("pattern/graphicalOutput"))) // NOLINT @@ -1151,6 +1152,18 @@ void VCommonSettings::SetHideLabels(bool value) setValue(*settingPatternHideLabels, value); } +//--------------------------------------------------------------------------------------------------------------------- +auto VCommonSettings::GetShowAccuracyRadius() const -> bool +{ + return value(*settingPatternShowAccuracyRadius, false).toBool(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCommonSettings::SetShowAccuracyRadius(bool value) +{ + setValue(*settingPatternShowAccuracyRadius, value); +} + //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetLabelDateFormat() const -> QString { diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h index e4410f9e1..359490188 100644 --- a/src/libs/vmisc/vcommonsettings.h +++ b/src/libs/vmisc/vcommonsettings.h @@ -213,6 +213,9 @@ public: auto GetHideLabels() const -> bool; void SetHideLabels(bool value); + auto GetShowAccuracyRadius() const -> bool; + void SetShowAccuracyRadius(bool value); + #if !defined(Q_OS_WIN) static const QString unixStandardSharePath; #endif diff --git a/src/libs/vwidgets/vscenepoint.cpp b/src/libs/vwidgets/vscenepoint.cpp index 483aa8b9b..220d9a2bc 100644 --- a/src/libs/vwidgets/vscenepoint.cpp +++ b/src/libs/vwidgets/vscenepoint.cpp @@ -69,8 +69,21 @@ void VScenePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio ScaleMainPenWidth(scale); ScaleCircleSize(this, scale); - if (VAbstractApplication::VApp()->Settings()->GetLabelFontSize()*scale < minVisibleFontSize || - VAbstractApplication::VApp()->Settings()->GetHideLabels()) + VCommonSettings *settings = VAbstractApplication::VApp()->Settings(); + + if (settings->GetShowAccuracyRadius()) + { + painter->save(); + QPen pen = painter->pen(); + pen.setWidthF(accuracyPointOnLine/15); + pen.setStyle(Qt::DashLine); + pen.setColor(Qt::black); + painter->setPen(pen); + painter->drawEllipse(PointRect(accuracyPointOnLine)); + painter->restore(); + } + + if (settings->GetLabelFontSize()*scale < minVisibleFontSize || settings->GetHideLabels()) { m_namePoint->setVisible(false); m_lineName->setVisible(false);