egui/crates
Emil Ernerfeldt c0a9800d05
Support interactive widgets in tooltips (#4596)
* Closes https://github.com/emilk/egui/issues/1010

### In short
You can now put interactive widgets, like buttons and hyperlinks, in an
tooltip using `on_hover_ui`. If you do, the tooltip will stay open as
long as the user hovers it.

There is a new demo for this in the egui demo app (egui.rs):


![interactive-tooltips](https://github.com/emilk/egui/assets/1148717/97335ba6-fa3e-40dd-9da0-1276a051dbf2)

### Design
Tooltips can now contain interactive widgets, such as buttons and links.
If they do, they will stay open when the user moves their pointer over
them.

Widgets that do not contain interactive widgets disappear as soon as you
no longer hover the underlying widget, just like before. This is so that
they won't annoy the user.

To ensure not all tooltips with text in them are considered interactive,
`selectable_labels` is `false` for tooltips contents by default. If you
want selectable text in tooltips, either change the `selectable_labels`
setting, or use `Label::selectable`.

```rs
ui.label("Hover me").on_hover_ui(|ui| {
    ui.style_mut().interaction.selectable_labels = true;
    ui.label("This text can be selected.");

    ui.add(egui::Label::new("This too.").selectable(true));
});
```

### Changes
* Layers in `Order::Tooltip` can now be interacted with
2024-06-03 11:37:06 +02:00
..
ecolor Move dependencies to workspace (#4495) 2024-05-14 11:02:49 +02:00
eframe Enforce eframe errors are `Send` and `Sync` (#4574) 2024-05-29 13:13:00 +02:00
egui Support interactive widgets in tooltips (#4596) 2024-06-03 11:37:06 +02:00
egui-wgpu Revert update to wgpu 0.20 => downgrade to wgpu 0.19.1 (#4559) 2024-05-28 14:40:43 +02:00
egui-winit Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_demo_app Replace some `...` with `…` 2024-05-29 11:48:50 +02:00
egui_demo_lib Support interactive widgets in tooltips (#4596) 2024-06-03 11:37:06 +02:00
egui_extras Add missing word (#4603) 2024-06-02 21:14:40 +02:00
egui_glow Do no use the ahash reimport (#4504) 2024-05-27 16:24:50 +02:00
egui_plot Replace some `...` with `…` 2024-05-29 11:48:50 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath `Rect::intersects_ray`: another bug fix (#4597) 2024-05-31 17:28:38 +02:00
epaint Bug fix: ui opacity and gray-out not affecting strokes (#4581) 2024-05-29 22:37:55 +02:00