summaryrefslogtreecommitdiff
path: root/client/collapser.cc
diff options
context:
space:
mode:
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);