From 46683949163047405c55efc42fdd3c79e96cde0d Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 4 Apr 2011 09:17:03 +0000 Subject: Fix journal view scrollbar jumpiness. Fix scroll to view on open of new macro. Added new attribute 'type' to checkgroupbox. --- client/collapser.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'client/collapser.cc') 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(); } } -- cgit v1.2.3