Rethink feature. Instead of hiding show main path.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-23 16:01:39 +03:00
parent 5c84c80039
commit 09bd14f382
5 changed files with 21 additions and 21 deletions

View File

@ -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<quint32> ids = pattern->DataPieces()->keys();
const bool updateChildren = false;
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));

View File

@ -1751,7 +1751,7 @@
<addaction name="separator"/>
<addaction name="actionLast_tool"/>
<addaction name="actionShowCurveDetails"/>
<addaction name="actionHideMainPath"/>
<addaction name="actionShowMainPath"/>
</widget>
<widget class="QMenu" name="menuMeasurements">
<property name="title">
@ -2834,7 +2834,7 @@
<string>Export recipe</string>
</property>
</action>
<action name="actionHideMainPath">
<action name="actionShowMainPath">
<property name="checkable">
<bool>true</bool>
</property>
@ -2842,10 +2842,10 @@
<bool>false</bool>
</property>
<property name="text">
<string>Hide main path</string>
<string>Show main path</string>
</property>
<property name="toolTip">
<string>Globally hide pieces main path</string>
<string>Globally show pieces main path</string>
</property>
</action>
</widget>

View File

@ -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);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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();

View File

@ -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();