From 0804cc1171dfe6430912eed8256a52a0bba8041e Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 10 Oct 2019 11:13:44 +0300 Subject: [PATCH] Use Enable/Disable instead of show/hide for button --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 1f969d0eb..1b65412e8 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -190,7 +190,7 @@ myIsSelection(false) myShowDOFBtn = new QPushButton(tr("Show remaining DoFs"), aSecondWgt); aLayout->addWidget(myShowDOFBtn); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); connect(myShowDOFBtn, SIGNAL(clicked(bool)), SLOT(onShowDOF())); myStackWidget->addWidget(aSecondWgt); @@ -759,18 +759,16 @@ bool PartSet_WidgetSketchLabel::restoreValueCustom() int aDoF = aVal.toInt(); if (aDoF == 0) { myDoFLabel->setText(tr("Sketch is fully fixed (DoF = 0)")); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); } else { myDoFLabel->setText(tr("DoF (degrees of freedom) = ") + aVal); - CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myFeature); - if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1) - myShowDOFBtn->show(); + myShowDOFBtn->setEnabled(true); } } } else { myDoFLabel->setText(""); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); } } return true; -- 2.39.2