From 29c7310559c541ed682b84756967fa24d06043ed Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 22 Sep 2008 12:18:43 +0000 Subject: Made the collapser able to update its contents even though they are already exposed. --- client/collapser.cc | 13 +++++++++---- 1 file 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 -#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() -- cgit v1.2.3