From 30c7af290a7f37c0f7b6bc37acb22f003dcf5d85 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 23 Dec 2012 22:57:06 +0100 Subject: [PATCH] close volume control if the mouse leaves it --- Vocaluxe/Base/CGraphics.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index 1dc275c2..7df673a0 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -33,7 +33,7 @@ namespace Vocaluxe.Base public bool ShowCursor; public bool Visible = true; public bool CursorVisible = true; - + public int X { get { return (int)_Cursor.rect.X; } @@ -177,6 +177,7 @@ namespace Vocaluxe.Base private static List _PopupScreens = new List(); private static Stopwatch _VolumePopupTimer; + private static bool CursorOverVolumeControl = false; public static float GlobalAlpha { @@ -630,7 +631,7 @@ namespace Vocaluxe.Base if (_CurrentPopupScreen == EPopupScreens.NoPopup && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) ShowPopup(EPopupScreens.PopupPlayerControl); } - + if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl) HidePopup(EPopupScreens.PopupPlayerControl); @@ -645,6 +646,17 @@ namespace Vocaluxe.Base } } + if (CursorOverVolumeControl && !isOverPopupVolumeControl) + { + if (_CurrentPopupScreen == EPopupScreens.PopupVolumeControl) + { + HidePopup(EPopupScreens.PopupVolumeControl); + _VolumePopupTimer.Reset(); + } + } + CursorOverVolumeControl = isOverPopupVolumeControl; + + bool handled = false; if (_CurrentPopupScreen != EPopupScreens.NoPopup) handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);