From bfbf23b4fb05795f9f51768f8258ec6898f5c3f7 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 25 Mar 2026 10:11:30 +0100 Subject: [PATCH] Add `Ui::is_tooltip` (#8016) --- crates/egui/src/ui.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index d55f4174f..0caf7bec5 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -487,6 +487,12 @@ impl Ui { &mut self.style_mut().visuals } + /// Is this [`Ui`] in a tooltip? + #[inline] + pub fn is_tooltip(&self) -> bool { + self.layer_id().order == Order::Tooltip + } + /// Get a reference to this [`Ui`]'s [`UiStack`]. #[inline] pub fn stack(&self) -> &Arc {