Skip to content

Commit 037c343

Browse files
committed
- Change InitializePosition for load setting
- add Save Position in onclosing - Remove Debug Log write
1 parent 6d8ee64 commit 037c343

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
8787
{
8888
Activate();
8989
QueryTextBox.Focus();
90-
UpdatePosition();
90+
//UpdatePosition();
9191
_settings.ActivateTimes++;
9292
if (!_viewModel.LastQuerySelected)
9393
{
@@ -156,10 +156,22 @@ private void OnLoaded(object sender, RoutedEventArgs _)
156156

157157
private void InitializePosition()
158158
{
159+
/*
159160
Top = WindowTop();
160161
Left = WindowLeft();
161162
_settings.WindowTop = Top;
162163
_settings.WindowLeft = Left;
164+
*/
165+
if (_settings.RememberLastLaunchLocation)
166+
{
167+
Left = _settings.WindowLeft;
168+
Top = _settings.WindowTop;
169+
}
170+
else
171+
{
172+
Left = WindowLeft();
173+
Top = WindowTop();
174+
}
163175
}
164176

165177
private void UpdateNotifyIconText()
@@ -265,17 +277,13 @@ public void WindowAnimator()
265277
Duration = TimeSpan.FromSeconds(0.1),
266278
FillBehavior = FillBehavior.Stop
267279
};
268-
System.Diagnostics.Debug.WriteLine("Left: " + Left);
269-
System.Diagnostics.Debug.WriteLine("Top: " + Top);
270280
Storyboard.SetTargetProperty(da3, new PropertyPath(Window.LeftProperty));
271-
sb.Children.Add(da3);
272281
Storyboard.SetTarget(da, this);
273282
Storyboard.SetTargetProperty(da, new PropertyPath(Window.OpacityProperty));
274283
Storyboard.SetTargetProperty(da2, new PropertyPath(Window.TopProperty));
275-
276284
sb.Children.Add(da);
277285
sb.Children.Add(da2);
278-
286+
sb.Children.Add(da3);
279287
sb.Begin(FlowMainWindow);
280288
}
281289

0 commit comments

Comments
 (0)