Skip to content

Add basic touchscreen support

Daniel Tang requested to merge danielt/ktexteditor:touch into master

Support scrolling with touchscreen gestures.

Before

The finger behaves like a mouse. Moving it only moves the cursor and selects text, unlike how one would expect. The only way to scroll is to touch the oversensitive scrollbar on the right or drag the finger out of the text area and wait.

After

I implemented basic QScroller kinetic vertical scrolling support. Horizontal scrolling, overscroll, scroll between lines, and word wrap awareness are out of the scope of this MR.

Additionally, moving the cursor with a single tap works. Double tapping to select a word doesn't work (it should really display selection handles). Triple clicking to select the line with the first two clicks done with a mouse works for some reason. For some reason, swiping horizontally starts text selection, and this continues when the drag is continued in any direction after that. Scrolling with the mouse wheel still works. A stylus still behaves like the mouse, and that's intended because that's what CLion does.

This MR considerably improves the user experience in a long file, such as when scrolling and completely reading the files changed

Edited by Daniel Tang

Merge request reports