From eeedebbac33367b78d3eccf5a92c6c83e81af600 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 3 Dec 2019 15:20:47 +0200 Subject: [PATCH] Fix regression in dialog Placelabel. --HG-- branch : develop --- .../dialogs/tools/piece/dialogplacelabel.cpp | 25 ++++++++----------- .../tools/piece/dialogseamallowance.cpp | 4 +-- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp index 84ec055fb..3e6555588 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp @@ -505,22 +505,19 @@ void DialogPlaceLabel::FillPlaceLabelTypes() //--------------------------------------------------------------------------------------------------------------------- void DialogPlaceLabel::CheckPieces() { - if (not m_showMode) + QColor color; + if (ui->comboBoxPiece->count() <= 0 || ui->comboBoxPiece->currentIndex() == -1) { - QColor color; - if (ui->comboBoxPiece->count() <= 0 || ui->comboBoxPiece->currentIndex() == -1) - { - m_flagError = false; - color = errorColor; - } - else - { - m_flagError = true; - color = OkColor(this); - } - ChangeColor(ui->labelPiece, color); - CheckState(); + m_flagError = false; + color = errorColor; } + else + { + m_flagError = true; + color = OkColor(this); + } + ChangeColor(ui->labelPiece, color); + CheckState(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 59b6b3b2f..2b8bb41e6 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -870,14 +870,14 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos) else if (selectedAction == actionOption) { auto *dialog = new DialogPlaceLabel(data, labelId, this); - dialog->SetCenterPoint(labelId); + dialog->EnbleShowMode(true); dialog->SetLabelType(currentLabel.GetLabelType()); dialog->SetWidth(currentLabel.GetWidthFormula()); dialog->SetHeight(currentLabel.GetHeightFormula()); dialog->SetAngle(currentLabel.GetAngleFormula()); dialog->SetFormulaVisible(currentLabel.GetVisibilityTrigger()); dialog->SetPieceId(toolId); - dialog->EnbleShowMode(true); + dialog->SetCenterPoint(currentLabel.GetCenterPoint()); m_dialog = dialog; m_dialog->setModal(true); connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PlaceLabelDialogClosed);