summaryrefslogtreecommitdiff
path: root/client/collapser.cc
diff options
context:
space:
mode:
authordeva <deva>2011-02-08 09:19:14 +0000
committerdeva <deva>2011-02-08 09:19:14 +0000
commita65a5d1594d09d575d9e835d684eb52675341054 (patch)
tree8829f4ffbb14b7f667fa054758e607b09fff0121 /client/collapser.cc
parent9d1dc91e1e2c11ea6df8e163b0e43f1dd43655d5 (diff)
Scroll into view when a new macro is expanded.
Diffstat (limited to 'client/collapser.cc')
-rw-r--r--client/collapser.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/collapser.cc b/client/collapser.cc
index 1d77c09..cbbd84e 100644
--- a/client/collapser.cc
+++ b/client/collapser.cc
@@ -31,11 +31,14 @@
#define ANIM_TIME 100
#define ANIM_INTERVAL 20
-Collapser::Collapser(QWidget *collapsed, QWidget *expanded, bool setcollapsed)
+Collapser::Collapser(QWidget *collapsed, QWidget *expanded, bool setcollapsed,
+ QScrollArea *scrollarea)
{
this->collapsed = NULL;
this->expanded = NULL;
+ this->scrollarea = scrollarea;
+
timer = new QTimer(this);
timer->setSingleShot(true);
timer->setInterval(ANIM_INTERVAL);
@@ -203,6 +206,11 @@ void Collapser::anim()
setFixedHeight(e_height);
emit doneExpanding();
+
+ if(scrollarea && expanded) {
+ scrollarea->ensureWidgetVisible(expanded);
+ }
+
}
}