summaryrefslogtreecommitdiff
path: root/client/collapser.cc
diff options
context:
space:
mode:
authorsenator <elsenator@gmail.com>2011-12-01 15:58:45 +0100
committersenator <elsenator@gmail.com>2011-12-01 15:58:45 +0100
commitbf3029b893e7138593d2d185d4ce9de26491a15e (patch)
tree557cd81a1cd3f192346dca187f006f7814d8a5e3 /client/collapser.cc
parent9989ea2f6bfa19bd349bbbdec8ec3f56c1427245 (diff)
parent5ed7a801b4194e72cc3898de57fb1d9ea0e8caa4 (diff)
Merge branch 'master' of http://git.aasimon.org/public/pracro
Diffstat (limited to 'client/collapser.cc')
-rw-r--r--client/collapser.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/client/collapser.cc b/client/collapser.cc
index 599397f..abbe295 100644
--- a/client/collapser.cc
+++ b/client/collapser.cc
@@ -32,8 +32,8 @@
#include "debug.h"
-#define ANIM_TIME 300 // ms
-#define ANIM_INTERVAL 5 // ms
+#define ANIM_TIME 200 // ms
+#define ANIM_INTERVAL 50 // ms
Collapser::Collapser(QWidget *current, QScrollArea *scroll)
{
@@ -110,8 +110,14 @@ void Collapser::anim()
placeholder.setWeight(x);
- int height = (int)((1 - y) * placeholder.fromHeight() +
- y * placeholder.toHeight());
+ // Make sure we don't 'bounce' around when animating to the same height.
+ int height;
+ if(placeholder.fromHeight() == placeholder.toHeight()) {
+ height = placeholder.toHeight();
+ } else {
+ height = (int)((1 - y) * placeholder.fromHeight() +
+ y * placeholder.toHeight());
+ }
setFixedHeight(height);