scrollToEnd() method provided to trigger 'snapping' the terminal to cursor tracked position (typically the extreme value of the scrollbar, or the 'end')

Some signal-fu particular to keyPressEvent(QKeyEvent *) done to make the above usable, no existing dependent implementations should be disturbed by this.
This commit is contained in:
Daniel O'Neill
2011-12-10 21:52:16 -07:00
parent 2be1dbb707
commit c462053b34
4 changed files with 29 additions and 0 deletions
+10
View File
@@ -1684,6 +1684,16 @@ void TerminalDisplay::setScroll(int cursor, int slines)
connect(_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollBarPositionChanged(int)));
}
void TerminalDisplay::scrollToEnd()
{
disconnect(_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollBarPositionChanged(int)));
_scrollBar->setValue( _scrollBar->maximum() );
connect(_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollBarPositionChanged(int)));
_screenWindow->scrollTo( _scrollBar->value() + 1 );
_screenWindow->setTrackOutput( _screenWindow->atEndOfOutput() );
}
void TerminalDisplay::setScrollBarPosition(ScrollBarPosition position)
{
if (_scrollbarLocation == position)