From 09bd14f382b586fa7f054a700079bce6ade0ee65 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 23 Jul 2019 16:01:39 +0300 Subject: [PATCH] Rethink feature. Instead of hiding show main path. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 10 +++++----- src/app/valentina/mainwindow.ui | 8 ++++---- src/libs/vmisc/vcommonsettings.cpp | 18 +++++++++--------- src/libs/vmisc/vcommonsettings.h | 4 ++-- src/libs/vtools/tools/vtoolseamallowance.cpp | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 93a7723d3..237bdbe08 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3066,7 +3066,7 @@ void MainWindow::Clear() ui->actionFinalMeasurements->setEnabled(false); ui->actionLast_tool->setEnabled(false); ui->actionShowCurveDetails->setEnabled(false); - ui->actionHideMainPath->setEnabled(false); + ui->actionShowMainPath->setEnabled(false); ui->actionLoadIndividual->setEnabled(false); ui->actionLoadMultisize->setEnabled(false); ui->actionUnloadMeasurements->setEnabled(false); @@ -3443,7 +3443,7 @@ void MainWindow::SetEnableWidgets(bool enable) ui->actionZoomFitBestCurrent->setEnabled(enable && drawStage); ui->actionZoomOriginal->setEnabled(enable); ui->actionShowCurveDetails->setEnabled(enable && drawStage); - ui->actionHideMainPath->setEnabled(enable && detailsStage); + ui->actionShowMainPath->setEnabled(enable && detailsStage); ui->actionLoadIndividual->setEnabled(enable && designStage); ui->actionLoadMultisize->setEnabled(enable && designStage); ui->actionUnloadMeasurements->setEnabled(enable && designStage); @@ -4496,10 +4496,10 @@ void MainWindow::CreateActions() qApp->ValentinaSettings()->SetShowCurveDetails(checked); }); - ui->actionHideMainPath->setChecked(qApp->ValentinaSettings()->IsPieceHideMainPath()); - connect(ui->actionHideMainPath, &QAction::triggered, this, [this](bool checked) + ui->actionShowMainPath->setChecked(qApp->ValentinaSettings()->IsPieceShowMainPath()); + connect(ui->actionShowMainPath, &QAction::triggered, this, [this](bool checked) { - qApp->ValentinaSettings()->SetPieceHideMainPath(checked); + qApp->ValentinaSettings()->SetPieceShowMainPath(checked); const QList ids = pattern->DataPieces()->keys(); const bool updateChildren = false; QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index 8bd89982e..f16efe662 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -1751,7 +1751,7 @@ - + @@ -2834,7 +2834,7 @@ Export recipe - + true @@ -2842,10 +2842,10 @@ false - Hide main path + Show main path - Globally hide pieces main path + Globally show pieces main path diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 31d0db754..7cb6e7cca 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -76,7 +76,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternLabelFont, (QLatin1String Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternLineWidth, (QLatin1String("pattern/lineWidth"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternCurveApproximationScale, (QLatin1String("pattern/curveApproximationScale"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternShowCurveDetails, (QLatin1String("pattern/showCurveDetails"))) -Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternPieceHideMainPath, (QLatin1String("pattern/pieceHideMainPath"))) +Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternPieceShowMainPath, (QLatin1String("pattern/pieceShowMainPath"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternLabelFontSize, (QLatin1String("pattern/labelFontSize"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternHideLabels, (QLatin1String("pattern/hideLabels"))) @@ -108,7 +108,7 @@ qreal curveApproximationCached = -1; Q_GLOBAL_STATIC(QString, localeCached) qreal lineWidthCached = 0; int labelFontSizeCached = 0; -int pieceHideMainPath = -1; +int pieceShowMainPath = -1; //--------------------------------------------------------------------------------------------------------------------- QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats) @@ -1148,20 +1148,20 @@ void VCommonSettings::SetShowCurveDetails(bool value) } //--------------------------------------------------------------------------------------------------------------------- -bool VCommonSettings::IsPieceHideMainPath() const +bool VCommonSettings::IsPieceShowMainPath() const { - if (pieceHideMainPath < 0) + if (pieceShowMainPath < 0) { - pieceHideMainPath = value(*settingPatternPieceHideMainPath, 0).toInt(); + pieceShowMainPath = value(*settingPatternPieceShowMainPath, 0).toInt(); } - return pieceHideMainPath; + return pieceShowMainPath; } //--------------------------------------------------------------------------------------------------------------------- -void VCommonSettings::SetPieceHideMainPath(bool value) +void VCommonSettings::SetPieceShowMainPath(bool value) { - pieceHideMainPath = value; - setValue(*settingPatternPieceHideMainPath, pieceHideMainPath); + pieceShowMainPath = value; + setValue(*settingPatternPieceShowMainPath, pieceShowMainPath); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h index 0cea45cf2..140a995a8 100644 --- a/src/libs/vmisc/vcommonsettings.h +++ b/src/libs/vmisc/vcommonsettings.h @@ -210,8 +210,8 @@ public: bool IsShowCurveDetails() const; void SetShowCurveDetails(bool value); - bool IsPieceHideMainPath() const; - void SetPieceHideMainPath(bool value); + bool IsPieceShowMainPath() const; + void SetPieceShowMainPath(bool value); static qreal DefaultLineWidth(); static qreal MinimalLineWidth(); diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 79d4d620e..3c6245632 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -1315,7 +1315,7 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren) QPainterPath path; - if ((not qApp->Settings()->IsPieceHideMainPath() && not detail.IsHideMainPath()) || not detail.IsSeamAllowance() + if (qApp->Settings()->IsPieceShowMainPath() || not detail.IsHideMainPath() || not detail.IsSeamAllowance() || detail.IsSeamAllowanceBuiltIn()) { m_mainPath = QPainterPath();