summaryrefslogtreecommitdiff
path: root/client/collapser.cc
diff options
context:
space:
mode:
authordeva <deva>2008-09-22 12:18:43 +0000
committerdeva <deva>2008-09-22 12:18:43 +0000
commit29c7310559c541ed682b84756967fa24d06043ed (patch)
treeb48a0bbe4c2afdf8e634e956a902276d7babb396 /client/collapser.cc
parent1b9cf53926a6627b9f8ed00a8dc1f4a784e6f295 (diff)
Made the collapser able to update its contents even though they are already exposed.
Diffstat (limited to 'client/collapser.cc')
-rw-r--r--client/collapser.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/collapser.cc b/client/collapser.cc
index 470db7a..fcf4a1d 100644
--- a/client/collapser.cc
+++ b/client/collapser.cc
@@ -28,8 +28,8 @@
#include <QHBoxLayout>
-#define ANIM_TIME 250
-#define ANIM_INTERVAL 25
+#define ANIM_TIME 100
+#define ANIM_INTERVAL 20
Collapser::Collapser(QWidget *collapsed, QWidget *expanded, bool setcollapsed)
{
@@ -54,7 +54,7 @@ void Collapser::setWidgets(QWidget *collapsed, QWidget *expanded)
void Collapser::setCollapsedWidget(QWidget *collapsed)
{
if(this->collapsed) {
- // delete this->collapsed;
+ delete this->collapsed;
this->collapsed = NULL;
}
@@ -64,11 +64,16 @@ void Collapser::setCollapsedWidget(QWidget *collapsed)
void Collapser::setExpandedWidget(QWidget *expanded)
{
if(this->expanded) {
- // delete this->expanded;
+ delete this->expanded;
this->expanded = NULL;
}
this->expanded = expanded;
+
+ if(isCollapsed() == false && expanded) {
+ layout()->addWidget(expanded);
+ expanded->setVisible(true);
+ }
}
QWidget *Collapser::collapsedWidget()