Browse Source

Changed ctkDirectoryListWidgetPrivate::onExpandClicked to take bool, and toggle visibility of group box

MattClarkson 13 years ago
parent
commit
eb53a30cb8
2 changed files with 5 additions and 12 deletions
  1. 4 11
      Libs/Widgets/ctkDirectoryListWidget.cpp
  2. 1 1
      Libs/Widgets/ctkDirectoryListWidget_p.h

+ 4 - 11
Libs/Widgets/ctkDirectoryListWidget.cpp

@@ -62,8 +62,8 @@ void ctkDirectoryListWidgetPrivate::setupUi(QWidget * widget)
                    this, SLOT(onAddClicked()));
   QObject::connect(this->RemoveButton, SIGNAL(clicked()),
                    this, SLOT(onRemoveClicked()));
-  QObject::connect(this->ExpandButton, SIGNAL(clicked()),
-                   this, SLOT(onExpandClicked()));
+  QObject::connect(this->ExpandButton, SIGNAL(clicked(bool)),
+                   this, SLOT(onExpandClicked(bool)));
   QObject::connect(this->DirectoryList, SIGNAL(directoryListChanged()),
                    this, SLOT(onDirectoryListChanged()));
 }
@@ -101,16 +101,9 @@ void ctkDirectoryListWidgetPrivate::onRemoveClicked()
 }
 
 //-----------------------------------------------------------------------------
-void ctkDirectoryListWidgetPrivate::onExpandClicked()
+void ctkDirectoryListWidgetPrivate::onExpandClicked(bool state)
 {
-  if (this->GroupBox->isVisible())
-  {
-    this->GroupBox->hide();
-  }
-  else
-  {
-    this->GroupBox->show();
-  }
+  this->GroupBox->setVisible(state);
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 1
Libs/Widgets/ctkDirectoryListWidget_p.h

@@ -51,7 +51,7 @@ public:
 public Q_SLOTS:
   void onAddClicked();
   void onRemoveClicked();
-  void onExpandClicked();
+  void onExpandClicked(bool);
   void onDirectoryListChanged();
 
 public: