summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-17 16:21:47 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-17 16:22:13 +0200
commitfebd5dec458e9fb066dab218b07d6c42b53ea5b1 (patch)
treeca82e4f98b1eaa3be5a9e0befd642e53a2518835 /plugingui
parent356b10b08ae2e12db0781922f6baaa4363115462 (diff)
Allow scrolling in TextEdit widget.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/textedit.cc5
-rw-r--r--plugingui/textedit.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/plugingui/textedit.cc b/plugingui/textedit.cc
index 357454e..63b4cd4 100644
--- a/plugingui/textedit.cc
+++ b/plugingui/textedit.cc
@@ -190,6 +190,11 @@ void TextEdit::repaintEvent(RepaintEvent* repaintEvent)
}
}
+void TextEdit::scrollEvent(ScrollEvent* scrollEvent)
+{
+ scroll.setValue(scroll.value() + scrollEvent->delta);
+}
+
void TextEdit::scrolled(int value)
{
(void)value;
diff --git a/plugingui/textedit.h b/plugingui/textedit.h
index 8df14b0..3eaf02f 100644
--- a/plugingui/textedit.h
+++ b/plugingui/textedit.h
@@ -61,6 +61,7 @@ public:
protected:
// From Widget
virtual void repaintEvent(RepaintEvent* repaintEvent) override;
+ void scrollEvent(ScrollEvent* scrollEvent) override;
private:
void scrolled(int value);