Added optional purely QML scrollbar.

This commit is contained in:
Filippo Scognamiglio
2014-11-12 17:05:17 +01:00
parent 2c911f9af6
commit dafc4f8e3b
6 changed files with 95 additions and 8 deletions
+20
View File
@@ -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"