Fix regression in dialog Placelabel.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-12-03 15:20:47 +02:00
parent 60fabf0b71
commit eeedebbac3
2 changed files with 13 additions and 16 deletions

View File

@ -505,22 +505,19 @@ void DialogPlaceLabel::FillPlaceLabelTypes()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogPlaceLabel::CheckPieces() void DialogPlaceLabel::CheckPieces()
{ {
if (not m_showMode) QColor color;
if (ui->comboBoxPiece->count() <= 0 || ui->comboBoxPiece->currentIndex() == -1)
{ {
QColor color; m_flagError = false;
if (ui->comboBoxPiece->count() <= 0 || ui->comboBoxPiece->currentIndex() == -1) color = errorColor;
{
m_flagError = false;
color = errorColor;
}
else
{
m_flagError = true;
color = OkColor(this);
}
ChangeColor(ui->labelPiece, color);
CheckState();
} }
else
{
m_flagError = true;
color = OkColor(this);
}
ChangeColor(ui->labelPiece, color);
CheckState();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -870,14 +870,14 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
else if (selectedAction == actionOption) else if (selectedAction == actionOption)
{ {
auto *dialog = new DialogPlaceLabel(data, labelId, this); auto *dialog = new DialogPlaceLabel(data, labelId, this);
dialog->SetCenterPoint(labelId); dialog->EnbleShowMode(true);
dialog->SetLabelType(currentLabel.GetLabelType()); dialog->SetLabelType(currentLabel.GetLabelType());
dialog->SetWidth(currentLabel.GetWidthFormula()); dialog->SetWidth(currentLabel.GetWidthFormula());
dialog->SetHeight(currentLabel.GetHeightFormula()); dialog->SetHeight(currentLabel.GetHeightFormula());
dialog->SetAngle(currentLabel.GetAngleFormula()); dialog->SetAngle(currentLabel.GetAngleFormula());
dialog->SetFormulaVisible(currentLabel.GetVisibilityTrigger()); dialog->SetFormulaVisible(currentLabel.GetVisibilityTrigger());
dialog->SetPieceId(toolId); dialog->SetPieceId(toolId);
dialog->EnbleShowMode(true); dialog->SetCenterPoint(currentLabel.GetCenterPoint());
m_dialog = dialog; m_dialog = dialog;
m_dialog->setModal(true); m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PlaceLabelDialogClosed); connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PlaceLabelDialogClosed);