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>
pull/180/head
Mavridis Philippe 2 years ago
parent 4e910c2ad6
commit 819074a379
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -3263,27 +3263,44 @@ void KateViewInternal::clear()
void KateViewInternal::wheelEvent(TQWheelEvent* e) void KateViewInternal::wheelEvent(TQWheelEvent* e)
{ {
if (m_lineScroll->minValue() != m_lineScroll->maxValue() && e->orientation() != Qt::Horizontal) { if (e->state() & ControlButton)
// React to this as a vertical event {
if ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) { if (e->delta() > 0)
if (e->delta() > 0) {
scrollPrevPage(); slotIncFontSizes();
else }
scrollNextPage(); else
} else { {
scrollViewLines(-((e->delta() / 120) * TQApplication::wheelScrollLines())); slotDecFontSizes();
// maybe a menu was opened or a bubbled window title is on us -> we shall erase it }
update(); }
leftBorder->update(); else
} {
if (m_lineScroll->minValue() != m_lineScroll->maxValue() && e->orientation() != Qt::Horizontal)
} else if (columnScrollingPossible()) { {
TQWheelEvent copy = *e; // React to this as a vertical event
TQApplication::sendEvent(m_columnScroll, &copy); if ( e->state() & ShiftButton )
{
} else { if (e->delta() > 0)
e->ignore(); 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, &copy);
} else {
e->ignore();
}
}
} }
void KateViewInternal::startDragScroll() void KateViewInternal::startDragScroll()

Loading…
Cancel
Save