From 63a95942ba9d11469813c0e78882cd91cdc3f66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 27 Nov 2025 04:17:10 +0100 Subject: [PATCH] Move delay constant to `Tooltip` struct --- widget/src/tooltip.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/widget/src/tooltip.rs b/widget/src/tooltip.rs index b3873e36..1502b94a 100644 --- a/widget/src/tooltip.rs +++ b/widget/src/tooltip.rs @@ -38,9 +38,6 @@ use crate::core::{ Shell, Size, Vector, }; -// Default tooltip delay, 2 seconds. Chosen because it's the default on macOS. -const DEFAULT_TOOLTIP_DELAY: Duration = Duration::from_millis(2000); - /// An element to display a widget over another. /// /// # Example @@ -91,6 +88,9 @@ where /// The default padding of a [`Tooltip`] drawn by this renderer. const DEFAULT_PADDING: f32 = 5.0; + /// The default delay before a [`Tooltip`] is shown. + const DEFAULT_DELAY: Duration = Duration::from_secs(2); + /// Creates a new [`Tooltip`]. /// /// [`Tooltip`]: struct.Tooltip.html @@ -106,7 +106,7 @@ where gap: 0.0, padding: Self::DEFAULT_PADDING, snap_within_viewport: true, - delay: DEFAULT_TOOLTIP_DELAY, + delay: Self::DEFAULT_DELAY, class: Theme::default(), } }