diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 6528f626c23..4588466652e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -88,8 +88,8 @@ public string Theme public double SettingWindowWidth { get; set; } = 1000; public double SettingWindowHeight { get; set; } = 700; - public double SettingWindowTop { get; set; } - public double SettingWindowLeft { get; set; } + public double? SettingWindowTop { get; set; } = null; + public double? SettingWindowLeft { get; set; } = null; public System.Windows.WindowState SettingWindowState { get; set; } = WindowState.Normal; public int CustomExplorerIndex { get; set; } = 0; diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 957379ce42d..de4fd1f9129 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -110,15 +110,15 @@ private void Window_StateChanged(object sender, EventArgs e) public void InitializePosition() { - if (_settings.SettingWindowTop == null) + if (_settings.SettingWindowTop == null || _settings.SettingWindowLeft == null) { Top = WindowTop(); Left = WindowLeft(); } else { - Top = _settings.SettingWindowTop; - Left = _settings.SettingWindowLeft; + Top = _settings.SettingWindowTop.Value; + Left = _settings.SettingWindowLeft.Value; } WindowState = _settings.SettingWindowState; } diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 48180204550..04dd6312b37 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -52,13 +52,13 @@ public double SettingWindowHeight set => Settings.SettingWindowHeight = value; } - public double SettingWindowTop + public double? SettingWindowTop { get => Settings.SettingWindowTop; set => Settings.SettingWindowTop = value; } - public double SettingWindowLeft + public double? SettingWindowLeft { get => Settings.SettingWindowLeft; set => Settings.SettingWindowLeft = value;