1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 15:33:14 -04:00

Don't show backdrop for popupkind tooltip

This commit is contained in:
lucasmerlin
2026-04-20 20:53:37 +02:00
parent 1468ed825d
commit 34f25e8155
2 changed files with 3 additions and 2 deletions

View File

@@ -623,8 +623,10 @@ impl<'a> Popup<'a> {
// - Explicit per-instance override takes priority
// - Otherwise, fall back to global style
// - Submenus (parent layer is Foreground) never show a backdrop
// - Tooltips never show a backdrop
let is_submenu = layer_id.order == Order::Foreground;
let show_backdrop = !is_submenu
&& kind != PopupKind::Tooltip
&& backdrop.unwrap_or_else(|| ctx.global_style().visuals.popup_backdrop);
let mut backdrop_clicked = false;

View File

@@ -28,8 +28,7 @@ impl Tooltip<'_> {
popup: Popup::new(parent_widget, ctx, anchor.into(), parent_layer)
.kind(PopupKind::Tooltip)
.gap(4.0)
.sense(Sense::hover())
.backdrop(false),
.sense(Sense::hover()),
parent_layer,
parent_widget,
}