Added optional purely QML scrollbar.
This commit is contained in:
@@ -387,6 +387,8 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent)
|
||||
|
||||
setFlags(ItemHasContents | ItemAcceptsInputMethod);
|
||||
|
||||
connect(_scrollBar, SIGNAL(valueChanged(int)), this, SIGNAL(scrollbarParamsChanged(int)));
|
||||
|
||||
// TODO Forcing rendering to Framebuffer. We need to determine if this is ok
|
||||
// always or if we need to make this customizable.
|
||||
setRenderTarget(QQuickPaintedItem::FramebufferObject);
|
||||
@@ -1713,6 +1715,9 @@ void TerminalDisplay::scrollBarPositionChanged(int)
|
||||
_screenWindow->setTrackOutput( atEndOfOutput );
|
||||
|
||||
updateImage();
|
||||
|
||||
// QMLTermWidget: notify qml side of the change only when needed.
|
||||
emit scrollbarValueChanged();
|
||||
}
|
||||
|
||||
void TerminalDisplay::setScroll(int cursor, int slines)
|
||||
@@ -3282,4 +3287,19 @@ bool TerminalDisplay::getUsesMouse()
|
||||
return !usesMouse();
|
||||
}
|
||||
|
||||
int TerminalDisplay::getScrollbarValue()
|
||||
{
|
||||
return _scrollBar->value();
|
||||
}
|
||||
|
||||
int TerminalDisplay::getScrollbarMaximum()
|
||||
{
|
||||
return _scrollBar->maximum();
|
||||
}
|
||||
|
||||
int TerminalDisplay::getScrollbarMinimum()
|
||||
{
|
||||
return _scrollBar->minimum();
|
||||
}
|
||||
|
||||
//#include "TerminalDisplay.moc"
|
||||
|
||||
Reference in New Issue
Block a user