summaryrefslogtreecommitdiff
path: root/client/collapser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/collapser.cc')
-rw-r--r--client/collapser.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/collapser.cc b/client/collapser.cc
index caf3117..599397f 100644
--- a/client/collapser.cc
+++ b/client/collapser.cc
@@ -47,6 +47,9 @@ Collapser::Collapser(QWidget *current, QScrollArea *scroll)
setLayout(new QHBoxLayout());
layout()->setContentsMargins(0,0,0,0);
+
+ connect(this, SIGNAL(scrollToViewSignal()),
+ this, SLOT(scrollToView()), Qt::QueuedConnection);
}
void Collapser::updateHeight()
@@ -90,6 +93,13 @@ void Collapser::animateToWidget(QWidget *widget, bool stv)
timer->start();
}
+void Collapser::scrollToView()
+{
+ if(scroll_to_view && scrollarea && current_widget) {
+ scrollarea->ensureWidgetVisible(current_widget);
+ }
+}
+
void Collapser::anim()
{
double x = (double)(t_anim.elapsed()) / (double)ANIM_TIME;
@@ -120,10 +130,7 @@ void Collapser::anim()
setFixedHeight(placeholder.toHeight());
emit doneAnimating(current_widget);
-
- if(scroll_to_view && scrollarea && current_widget) {
- scrollarea->ensureWidgetVisible(current_widget);
- }
+ emit scrollToViewSignal();
}
}