Skip to content

Kate-like touchscreen scrolling support

Summary

Adds minimalistic touchscreen scrolling support. This is an adaptation of Daniel Tang's MR 123 that was submitted to Kate/KWrite for Konsole.

Fixes https://bugs.kde.org/show_bug.cgi?id=437553

Notes

  • Functionality implemented in the earlier #318 not covered by this MR will (hopefully!) be the subject of follow-up pull requests.
  • The goal of this MR is to quickly add minimalistic touchscreen support to Konsole.

Testing (if you don't have a touchscreen)

In TerminalDisplay::TerminalDisplay, add the line that starts with a + below. This should be near line 310 of TerminalDisplay.cpp.

    QScroller::scroller(this)->setScrollerProperties(prop);
    QScroller::scroller(this)->grabGesture(this);
+    QScroller::scroller(this)->grabGesture(this, QScroller::LeftMouseButtonGesture);

    // Add the stretch item once, the KMessageWidgets are inserted at index 0.
    _verticalLayout->addWidget(_headerBar);
    _verticalLayout->addStretch();

With this change, clicking and dragging should trigger inertial scrolling.

Edited by Henry Heino

Merge request reports

Loading