mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Remove redundant animation and potential position change
This commit is contained in:
parent
6744e21775
commit
ca2d696791
1 changed files with 13 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ namespace Flow.Launcher
|
|||
private NotifyIcon _notifyIcon;
|
||||
private ContextMenu contextMenu;
|
||||
private MainViewModel _viewModel;
|
||||
private bool _animating;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -37,8 +38,8 @@ namespace Flow.Launcher
|
|||
DataContext = mainVM;
|
||||
_viewModel = mainVM;
|
||||
_settings = settings;
|
||||
InitializePosition();
|
||||
InitializeComponent();
|
||||
InitializePosition();
|
||||
}
|
||||
|
||||
public MainWindow()
|
||||
|
|
@ -180,7 +181,7 @@ namespace Flow.Launcher
|
|||
|
||||
var header = new MenuItem
|
||||
{
|
||||
Header = "Flow Launcher",
|
||||
Header = "Flow Launcher",
|
||||
IsEnabled = false
|
||||
};
|
||||
var open = new MenuItem
|
||||
|
|
@ -237,6 +238,10 @@ namespace Flow.Launcher
|
|||
|
||||
public void WindowAnimator()
|
||||
{
|
||||
if (_animating)
|
||||
return;
|
||||
|
||||
_animating = true;
|
||||
UpdatePosition();
|
||||
Storyboard sb = new Storyboard();
|
||||
var da = new DoubleAnimation
|
||||
|
|
@ -269,6 +274,7 @@ namespace Flow.Launcher
|
|||
sb.Children.Add(da);
|
||||
sb.Children.Add(da2);
|
||||
sb.Children.Add(da3);
|
||||
sb.Completed += (_, _) => _animating = false;
|
||||
sb.Begin(FlowMainWindow);
|
||||
}
|
||||
|
||||
|
|
@ -322,6 +328,9 @@ namespace Flow.Launcher
|
|||
|
||||
private void UpdatePosition()
|
||||
{
|
||||
if (_animating)
|
||||
return;
|
||||
|
||||
if (_settings.RememberLastLaunchLocation)
|
||||
{
|
||||
Left = _settings.WindowLeft;
|
||||
|
|
@ -337,6 +346,8 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnLocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_animating)
|
||||
return;
|
||||
if (_settings.RememberLastLaunchLocation)
|
||||
{
|
||||
_settings.WindowLeft = Left;
|
||||
|
|
|
|||
Loading…
Reference in a new issue