diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2022-10-16 15:55:45 +0300 |
---|---|---|
committer | Emanoil Kotsev <deloptes@gmail.com> | 2022-11-05 08:09:18 +0000 |
commit | 75b741adec5d3316b988fb6a68da574f90024d5d (patch) | |
tree | a0deffb4d28e89941ffd36e34e3447906b2be96a | |
parent | 8f3be4fc0b1448038fd1448d53544d1d878d1e1c (diff) | |
download | tdelibs-75b741adec5d3316b988fb6a68da574f90024d5d.tar.gz tdelibs-75b741adec5d3316b988fb6a68da574f90024d5d.zip |
Kate Part: Ctrl+Mouse Scroll to change font size
As seen in most applications out there. ;-)
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Fixed functionality of CTRL+Mouse Wheel when scrolling is not enabled.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | kate/part/kateviewinternal.cpp | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/kate/part/kateviewinternal.cpp b/kate/part/kateviewinternal.cpp index c536974e6..5acb93bc8 100644 --- a/kate/part/kateviewinternal.cpp +++ b/kate/part/kateviewinternal.cpp @@ -3263,27 +3263,44 @@ void KateViewInternal::clear() void KateViewInternal::wheelEvent(TQWheelEvent* e) { - if (m_lineScroll->minValue() != m_lineScroll->maxValue() && e->orientation() != Qt::Horizontal) { - // React to this as a vertical event - if ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) { - if (e->delta() > 0) - scrollPrevPage(); - else - scrollNextPage(); - } else { - scrollViewLines(-((e->delta() / 120) * TQApplication::wheelScrollLines())); - // maybe a menu was opened or a bubbled window title is on us -> we shall erase it - update(); - leftBorder->update(); - } - - } else if (columnScrollingPossible()) { - TQWheelEvent copy = *e; - TQApplication::sendEvent(m_columnScroll, ©); - - } else { - e->ignore(); - } + if (e->state() & ControlButton) + { + if (e->delta() > 0) + { + slotIncFontSizes(); + } + else + { + slotDecFontSizes(); + } + } + else + { + if (m_lineScroll->minValue() != m_lineScroll->maxValue() && e->orientation() != Qt::Horizontal) + { + // React to this as a vertical event + if ( e->state() & ShiftButton ) + { + if (e->delta() > 0) + scrollPrevPage(); + else + scrollNextPage(); + } + else + { + scrollViewLines(-((e->delta() / 120) * TQApplication::wheelScrollLines())); + // maybe a menu was opened or a bubbled window title is on us -> we shall erase it + update(); + leftBorder->update(); + } + } else if (columnScrollingPossible()) { + TQWheelEvent copy = *e; + TQApplication::sendEvent(m_columnScroll, ©); + + } else { + e->ignore(); + } + } } void KateViewInternal::startDragScroll() |