From 40f7980c18db9fd782618c751afd341ca1cbaa92 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Wed, 5 Oct 2022 22:05:27 -0500 Subject: [PATCH 1/4] hide tooltip while dragging --- Source/Engine/UI/GUI/Control.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 8384741bc..351e105a8 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -960,6 +960,12 @@ namespace FlaxEngine.GUI [NoAnimate] public virtual DragDropEffect OnDragMove(ref Float2 location, DragData data) { + // Update tooltip + if (_tooltipUpdate != null) + { + SetUpdate(ref _tooltipUpdate, null); + Tooltip.Hide(); + } return DragDropEffect.None; } From 79ccda38837cccf73b119da8e02867be25c1eef4 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 6 Oct 2022 16:49:35 -0500 Subject: [PATCH 2/4] Moved code to on drag enter to minimize calls. --- Source/Engine/UI/GUI/Control.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 351e105a8..19b7761cb 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -948,6 +948,11 @@ namespace FlaxEngine.GUI { // Set flag _isDragOver = true; + // Update tooltip + if (_tooltipUpdate != null) + { + Tooltip.Hide(); + } return DragDropEffect.None; } @@ -960,12 +965,6 @@ namespace FlaxEngine.GUI [NoAnimate] public virtual DragDropEffect OnDragMove(ref Float2 location, DragData data) { - // Update tooltip - if (_tooltipUpdate != null) - { - SetUpdate(ref _tooltipUpdate, null); - Tooltip.Hide(); - } return DragDropEffect.None; } From 2d42ca522dcc613e6ced8966cad9b75e5613ac86 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 6 Oct 2022 16:51:25 -0500 Subject: [PATCH 3/4] Fixed spacing and comment --- Source/Engine/UI/GUI/Control.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 19b7761cb..992194925 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -948,11 +948,13 @@ namespace FlaxEngine.GUI { // Set flag _isDragOver = true; - // Update tooltip + + // Hide tooltip if (_tooltipUpdate != null) { Tooltip.Hide(); } + return DragDropEffect.None; } From 091fe0a40a44e46b584179282da9794092ed0a0b Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 6 Oct 2022 19:12:46 -0500 Subject: [PATCH 4/4] Simplified tool tip hide --- Source/Engine/UI/GUI/Control.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 992194925..86c242609 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -950,11 +950,8 @@ namespace FlaxEngine.GUI _isDragOver = true; // Hide tooltip - if (_tooltipUpdate != null) - { - Tooltip.Hide(); - } - + Tooltip?.Hide(); + return DragDropEffect.None; }