mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Include popups and tooltips in Harness::fit_contents (#7556)
This makes `Harness::fit_contents` also use popups and tooltips to compute the size of the contents.
This commit is contained in:
@@ -16,6 +16,28 @@ fn test_shrink() {
|
||||
harness.snapshot("test_shrink");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tooltip() {
|
||||
let mut harness = Harness::new_ui(|ui| {
|
||||
ui.label("Hello, world!");
|
||||
ui.separator();
|
||||
ui.label("This is a test")
|
||||
.on_hover_text("This\nis\na\nvery\ntall\ntooltip!");
|
||||
});
|
||||
|
||||
harness.fit_contents();
|
||||
|
||||
#[cfg(all(feature = "snapshot", feature = "wgpu"))]
|
||||
harness.snapshot("test_tooltip_hidden");
|
||||
|
||||
harness.get_by_label("This is a test").hover();
|
||||
harness.run_ok();
|
||||
harness.fit_contents();
|
||||
|
||||
#[cfg(all(feature = "snapshot", feature = "wgpu"))]
|
||||
harness.snapshot("test_tooltip_shown");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_modifiers() {
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in New Issue
Block a user