Diffstat (limited to 'core/pim/todo/textviewshow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/textviewshow.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/pim/todo/textviewshow.cpp b/core/pim/todo/textviewshow.cpp index fe8a9c8..35ea74b 100644 --- a/core/pim/todo/textviewshow.cpp +++ b/core/pim/todo/textviewshow.cpp | |||
@@ -1,5 +1,4 @@ | |||
1 | #include "mainwindow.h" | ||
2 | #include "textviewshow.h" | 1 | #include "textviewshow.h" |
3 | 2 | ||
4 | using namespace Todo; | 3 | using namespace Todo; |
5 | 4 | ||
@@ -19,11 +18,28 @@ QWidget* TextViewShow::widget() { | |||
19 | return this; | 18 | return this; |
20 | } | 19 | } |
21 | void TextViewShow::keyPressEvent( QKeyEvent* event ) { | 20 | void TextViewShow::keyPressEvent( QKeyEvent* event ) { |
22 | switch( event->key() ) { | 21 | switch( event->key() ) { |
22 | case Qt::Key_Up: | ||
23 | if ( ( visibleHeight() < contentsHeight() ) && | ||
24 | ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) ) | ||
25 | scrollBy( 0, -(visibleHeight()-20) ); | ||
26 | else | ||
27 | showPrev(); | ||
28 | break; | ||
29 | case Qt::Key_Down: | ||
30 | if ( ( visibleHeight() < contentsHeight() ) && | ||
31 | ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) ) | ||
32 | scrollBy( 0, visibleHeight()-20 ); | ||
33 | else | ||
34 | showNext(); | ||
35 | break; | ||
36 | case Qt::Key_Left: | ||
37 | case Qt::Key_Right: | ||
23 | case Qt::Key_F33: | 38 | case Qt::Key_F33: |
24 | case Qt::Key_Enter: | 39 | case Qt::Key_Enter: |
25 | case Qt::Key_Return: | 40 | case Qt::Key_Return: |
41 | case Qt::Key_Space: | ||
26 | escapeView(); | 42 | escapeView(); |
27 | break; | 43 | break; |
28 | default: | 44 | default: |
29 | QTextView::keyPressEvent( event ); | 45 | QTextView::keyPressEvent( event ); |