1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[AutoScroll] Add scrolling icons (from Oxygen cursor theme)

Also scroll timer interval is now 10 msecs, so scrolling will be a
little faster.
This commit is contained in:
nowrep 2014-02-18 15:15:42 +01:00
parent ed99915bff
commit 7323fb1cad
7 changed files with 17 additions and 4 deletions

View File

@ -1,4 +1,7 @@
<RCC>
<qresource prefix="/autoscroll">
<file>data/scroll_all.png</file>
<file>data/scroll_horizontal.png</file>
<file>data/scroll_vertical.png</file>
</qresource>
</RCC>

View File

@ -32,8 +32,8 @@ AutoScroller::AutoScroller(const QString &settings, QObject* parent)
Q_UNUSED(settings)
m_indicator = new QLabel;
m_indicator->resize(30, 30);
m_indicator->setStyleSheet("QLabel{background-color: red;}");
m_indicator->resize(32, 32);
m_indicator->setContentsMargins(0, 0, 0, 0);
m_indicator->installEventFilter(this);
m_frameScroller = new FrameScroller(this);
@ -147,6 +147,16 @@ bool AutoScroller::showIndicator(WebView* view, const QPoint &pos)
return false;
}
if (vertical && horizontal) {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_all.png"));
}
else if (vertical) {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_vertical.png"));
}
else {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_horizontal.png"));
}
m_view = view;
QPoint p;

View File

@ -35,7 +35,7 @@ PluginSpec AutoScrollPlugin::pluginSpec()
spec.name = "AutoScroll";
spec.info = "AutoScroll plugin";
spec.description = "Provides support for autoscroll with middle mouse button";
spec.version = "0.1.0";
spec.version = "0.1.1";
spec.author = "David Rosca <nowrep@gmail.com>";
spec.icon = QPixmap(":/autoscroll/data/icon.png");
spec.hasSettings = false;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -28,7 +28,7 @@ FrameScroller::FrameScroller(QObject* parent)
, m_lengthY(0)
{
m_timer = new QTimer(this);
m_timer->setInterval(20);
m_timer->setInterval(10);
connect(m_timer, SIGNAL(timeout()), this, SLOT(scrollStep()));
}