]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Use Enable/Disable instead of show/hide for button
authorvsv <vsv@opencascade.com>
Thu, 10 Oct 2019 08:13:44 +0000 (11:13 +0300)
committervsv <vsv@opencascade.com>
Thu, 10 Oct 2019 08:14:09 +0000 (11:14 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp

index 1f969d0ebd6ccb0ae0ba447d60fe17ea7d4d2353..1b65412e84c01db704cdcba5ee8ed0a9d819028b 100644 (file)
@@ -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<ModelAPI_CompositeFeature>(myFeature);
-          if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1)
-            myShowDOFBtn->show();
+          myShowDOFBtn->setEnabled(true);
         }
       }
     }
     else {
       myDoFLabel->setText("");
-      myShowDOFBtn->hide();
+      myShowDOFBtn->setEnabled(false);
     }
   }
   return true;