diff options
author | Mavridis Philippe <[email protected]> | 2022-10-16 15:55:45 +0300 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2022-10-19 11:32:16 +0300 |
commit | 819074a37969e373fa04bcdc306dcaa79cf31782 (patch) | |
tree | a0364ecb8bef15bfb4c6c88442fc82f07fc30b1f | |
parent | 4e910c2ad620b3c4455066588b53bd56e405bc55 (diff) | |
download | tdelibs-819074a37969e373fa04bcdc306dcaa79cf31782.tar.gz tdelibs-819074a37969e373fa04bcdc306dcaa79cf31782.zip |
Kate Part: Ctrl+Mouse Scroll to change font size
As seen in most applications out there. ;-)
Signed-off-by: Mavridis Philippe <[email protected]>
Fixed functionality of CTRL+Mouse Wheel when scrolling is not enabled.
Signed-off-by: Michele Calgaro <[email protected]>
-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() |