From 15255ddf147feca7eaf361be09cd115e2dd52f29 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 29 May 2024 17:40:56 +0900 Subject: [PATCH 1/4] Fix Logic --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 1 + Flow.Launcher/SettingWindow.xaml.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 6528f626c23..d3b3c1910ce 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -88,6 +88,7 @@ public string Theme public double SettingWindowWidth { get; set; } = 1000; public double SettingWindowHeight { get; set; } = 700; + public bool SettingWindowFirstLaunch { get; set; } = true; public double SettingWindowTop { get; set; } public double SettingWindowLeft { get; set; } public System.Windows.WindowState SettingWindowState { get; set; } = WindowState.Normal; diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 957379ce42d..66bba05cb65 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -110,10 +110,11 @@ private void Window_StateChanged(object sender, EventArgs e) public void InitializePosition() { - if (_settings.SettingWindowTop == null) + if (_settings.SettingWindowFirstLaunch || _settings.SettingWindowFirstLaunch == null) { Top = WindowTop(); Left = WindowLeft(); + _settings.SettingWindowFirstLaunch = false; } else { From 6ad21bd63633d9f60d9531815767bffadc8264b6 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 29 May 2024 18:16:35 +0900 Subject: [PATCH 2/4] Fix Logic --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 4 ++-- Flow.Launcher/SettingWindow.xaml.cs | 6 +++--- Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index d3b3c1910ce..39c096f80bf 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -89,8 +89,8 @@ public string Theme public double SettingWindowWidth { get; set; } = 1000; public double SettingWindowHeight { get; set; } = 700; public bool SettingWindowFirstLaunch { get; set; } = true; - 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 66bba05cb65..e6e4090e619 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -110,7 +110,7 @@ private void Window_StateChanged(object sender, EventArgs e) public void InitializePosition() { - if (_settings.SettingWindowFirstLaunch || _settings.SettingWindowFirstLaunch == null) + if (_settings.SettingWindowTop == null || _settings.SettingWindowLeft == null) { Top = WindowTop(); Left = WindowLeft(); @@ -118,8 +118,8 @@ public void InitializePosition() } 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; From 2be21eeae6b03e3f61b10e7fa9316a44ba6df466 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 29 May 2024 18:18:03 +0900 Subject: [PATCH 3/4] Remove SettingWIndowFirstLaunch --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 39c096f80bf..4588466652e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -88,7 +88,6 @@ public string Theme public double SettingWindowWidth { get; set; } = 1000; public double SettingWindowHeight { get; set; } = 700; - public bool SettingWindowFirstLaunch { get; set; } = true; public double? SettingWindowTop { get; set; } = null; public double? SettingWindowLeft { get; set; } = null; public System.Windows.WindowState SettingWindowState { get; set; } = WindowState.Normal; From 664dde9778000804d5397c618913b38423ef4a7a Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 29 May 2024 18:18:50 +0900 Subject: [PATCH 4/4] Remove FirstLaunchValue --- Flow.Launcher/SettingWindow.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index e6e4090e619..de4fd1f9129 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -114,7 +114,6 @@ public void InitializePosition() { Top = WindowTop(); Left = WindowLeft(); - _settings.SettingWindowFirstLaunch = false; } else {