From fbdb0c502893716a65073c68d67b99d62620c32f Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 4 Apr 2011 11:40:47 +0000 Subject: Final fix for journal scrolling behaviour (finally scrolls correctly to bottom on init) --- client/viewer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/viewer.cc b/client/viewer.cc index 4a194b4..170210c 100644 --- a/client/viewer.cc +++ b/client/viewer.cc @@ -118,6 +118,7 @@ Viewer::Viewer(QString cpr, QString templs, QString host, quint16 port, l->addWidget(journal); init(); + show(); update(); } @@ -220,8 +221,8 @@ void Viewer::update() int max = journal->verticalScrollBar()->maximum(); int pos = journal->verticalScrollBar()->value(); journal->setPlainText(jstrip); - // Scroll to bottom if we were there already or on first update. - if(pos == max || jlast == "") pos = journal->verticalScrollBar()->maximum(); + // Scroll to bottom if we were there already + if(pos == max) pos = journal->verticalScrollBar()->maximum(); journal->verticalScrollBar()->setValue(pos); jlast = jstrip; } -- cgit v1.2.3