Skip to content

Commit 6ad21bd

Browse files
committed
Fix Logic
1 parent 15255dd commit 6ad21bd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public string Theme
8989
public double SettingWindowWidth { get; set; } = 1000;
9090
public double SettingWindowHeight { get; set; } = 700;
9191
public bool SettingWindowFirstLaunch { get; set; } = true;
92-
public double SettingWindowTop { get; set; }
93-
public double SettingWindowLeft { get; set; }
92+
public double? SettingWindowTop { get; set; } = null;
93+
public double? SettingWindowLeft { get; set; } = null;
9494
public System.Windows.WindowState SettingWindowState { get; set; } = WindowState.Normal;
9595

9696
public int CustomExplorerIndex { get; set; } = 0;

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ private void Window_StateChanged(object sender, EventArgs e)
110110

111111
public void InitializePosition()
112112
{
113-
if (_settings.SettingWindowFirstLaunch || _settings.SettingWindowFirstLaunch == null)
113+
if (_settings.SettingWindowTop == null || _settings.SettingWindowLeft == null)
114114
{
115115
Top = WindowTop();
116116
Left = WindowLeft();
117117
_settings.SettingWindowFirstLaunch = false;
118118
}
119119
else
120120
{
121-
Top = _settings.SettingWindowTop;
122-
Left = _settings.SettingWindowLeft;
121+
Top = _settings.SettingWindowTop.Value;
122+
Left = _settings.SettingWindowLeft.Value;
123123
}
124124
WindowState = _settings.SettingWindowState;
125125
}

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public double SettingWindowHeight
5252
set => Settings.SettingWindowHeight = value;
5353
}
5454

55-
public double SettingWindowTop
55+
public double? SettingWindowTop
5656
{
5757
get => Settings.SettingWindowTop;
5858
set => Settings.SettingWindowTop = value;
5959
}
6060

61-
public double SettingWindowLeft
61+
public double? SettingWindowLeft
6262
{
6363
get => Settings.SettingWindowLeft;
6464
set => Settings.SettingWindowLeft = value;

0 commit comments

Comments
 (0)