egui/crates/epaint
Emil Ernerfeldt 5d2e192927
Selectable text in Labels (#3814)
* Closes https://github.com/emilk/egui/issues/3804

Add ability to select the text in labels with mouse-drag, double-click,
and keyboard (once clicked).
Hit Cmd+C to copy the text. If everything of a label with elided text is
selected, the copy command will copy the full non-elided text. IME and
accesskit _should_ work, but is untested.

You can control wether or not text in labels is selected globally in
`style.interaction.selectable_labels` or on a per-label basis in
`Label::selectable`. The default is ON.

This also cleans up the `TextEdit` code somewhat, fixing a couple
smaller bugs along the way.

This does _not_ implement selecting text across multiple widgets. Text
selection is only supported within a single `Label`, `TextEdit`, `Link`
or `Hyperlink`.


![label-text-selection](https://github.com/emilk/egui/assets/1148717/c161e819-50da-4b97-9686-042e6abf3564)


## TODO
* [x] Test
2024-01-14 15:17:55 +01:00
..
benches Refactor: turn `ClippedShape` from struct-enum to a normal struct (#3225) 2023-08-10 14:50:11 +02:00
fonts Move all crates into a `crates` directory (#1940) 2022-08-20 10:41:49 +02:00
src Selectable text in Labels (#3814) 2024-01-14 15:17:55 +01:00
CHANGELOG.md Release 0.25.0 - Better keyboard input 2024-01-08 12:25:43 +01:00
Cargo.toml Release 0.25.0 - Better keyboard input 2024-01-08 12:25:43 +01:00
README.md Add badges to all crates' README.md 2023-02-12 18:08:13 +01:00

README.md

epaint - egui paint library

Latest version Documentation unsafe forbidden MIT Apache

A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.