Implement full mouse- and touch-based text selection

Authored by hein on Sep 17 2017, 2:07 AM.

Description

Implement full mouse- and touch-based text selection

Text selection has three modes now:

  • Inline selection in the message text under the mouse pointer.
  • If the mouse pointer is above a message but not the message text and a hold-and-move occurs, or when the pointer exits the message text during a hold-and-move, the full message is selected as well as additional messages as the mouse moves across them. The view is scrolled (auto-scroll) when the mouse pointer exits the viewport and the selection range updated accordingly.
  • If a message is long-pressed (e.g. by touch) it is selected and a mode is entered in which messages can be selected and deselected by simple tap/click.

When copying inline-selected text, the selected text is copied to
the clipboard buffer as is. When copying fully-selected messages,
a special clipboard-friendly serialization is copied to the clip-
board buffer instead. The clipboard serialization has a more
exchange-friendly layout that e.g. does repeat the timestamp and
author for every message, unlike the actual view.

The SELECTION buffer is updated whenever the selection changes,
with the value it is set to determined as above.

Various related changes, e.g. in addition to the I-beam cursors
you now get when a selection is possible, hovering links now shows
a pointing hand cursor.

Note: You can currently only copy by keyboard shortcut, the
context menu isn't back yet.

Next: Keyboard-based text selection.

Details

Committed
heinSep 17 2017, 2:16 AM
Parents
R7:db31a6b79779: Tighter selection rect for group parents.
Branches
Unknown
Tags
Unknown