egui/crates/epaint/src
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
..
text Selectable text in Labels (#3814) 2024-01-14 15:17:55 +01:00
util Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
bezier.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
image.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
lib.rs Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
mesh.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
mutex.rs Use `impl Into<Stroke>` as argument in a few more places (#3420) 2023-11-10 21:36:51 +01:00
shadow.rs Style tweaks (#2406) 2022-12-08 10:55:13 +01:00
shape.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
shape_transform.rs Fix text color of disabled widgets (#3744) 2023-12-28 11:16:39 +01:00
stats.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
stroke.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
tessellator.rs Replace a special `Color32::PLACEHOLDER` with widget fallback color (#3727) 2023-12-22 15:09:10 +01:00
texture_atlas.rs Fix buggy text withviewports on monitors with different scales (#3666) 2023-11-30 15:56:05 +01:00
texture_handle.rs Improved texture loading (#3315) 2023-09-12 10:39:17 +02:00
textures.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00