mirror of
https://github.com/storytold/egui.git
synced 2026-11-21 18:12:42 +01:00
* Closes <https://github.com/emilk/egui/issues/2550> * [x] I have followed the instructions in the PR template Double-click-and-drag now extends the selection by whole words, and triple-click-and-drag by whole lines — in both `TextEdit` and labels, including selections spanning multiple labels.  The reason this was missing: clicks are only counted on pointer *release*, so at the start of a drag nothing knew it began with a double-click. * `PointerState` now also computes the would-be click count at *press* time (`pub(crate)` only, same heuristics as the click counting on release). * On a second/third press, `TextCursorState` selects the word/line under the pointer immediately and remembers it as the anchor; while dragging, the selection is the union of the anchor and the word/line under the pointer. A side effect is that plain double-click selection now appears on press rather than release, matching other UI toolkits. * `LabelSelectionState` carries the anchor across passes, so the drag can extend into neighboring labels. No public API changes. Covered by unit tests for the range math and kittest tests for `TextEdit` (forward/backward/lines) and cross-label drags in `tests/egui_tests/tests/test_text_selection.rs`. --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Test apps
Some application to tests various parts of egui and eframe.
At some point it would be nice to have automatic screenshot regression tests for these.