Skip to content

Commit

Permalink
Improved entrace animation
Browse files Browse the repository at this point in the history
Fixed an issue when the region where flyout should be shown becomes blurry before the animation is finished
  • Loading branch information
krlvm committed Dec 18, 2021
1 parent 4fad2f0 commit f66bfd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions MediaFlyout/FlyoutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public FlyoutWindow()

private void PrepareWindow()
{
Left = 99999;
Left = 999999;
Show();
Hide();
}
Expand Down Expand Up @@ -87,10 +87,11 @@ private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
public async void DismissFlyout()
{
if (Visibility == Visibility.Hidden) return;
WindowStyle = WindowStyle.None;
Visibility = Visibility.Hidden;
Left = 999999;
tray.isClosing = true;
await System.Threading.Tasks.Task.Delay(System.Windows.Forms.SystemInformation.DoubleClickTime / 2);
WindowStyle = WindowStyle.None;
Visibility = Visibility.Hidden;
tray.isClosing = false;
}

Expand Down
4 changes: 3 additions & 1 deletion MediaFlyout/Helpers/AnimationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public static void ShowFlyout<T>(T window, bool topmost = false) where T : Windo

//window.IsRaising = true;
BringTaskbarToFront();
window.Visibility = Visibility.Visible;
if (property == Window.TopProperty) window.Top = 999999; else window.Left = 999999;
window.WindowStyle = WindowStyle.SingleBorderWindow;
window.Visibility = Visibility.Visible;
System.Threading.Thread.Sleep(1);
window.Activate();
InteropHelper.CloakWindow(window, false);

Expand Down

0 comments on commit f66bfd7

Please sign in to comment.