Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Aug 30, 2024
1 parent 1d48b56 commit 92c4927
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions JL.Core/Config/StatsDBUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void InsertStats(SqliteConnection connection, Stats stats, int pro
InsertStats(connection, JsonSerializer.Serialize(stats, Utils.s_jsoWithEnumConverterAndIndentation), profileId);
}

public static void InsertStats(SqliteConnection connection, string stats, int profileId)
private static void InsertStats(SqliteConnection connection, string stats, int profileId)
{
using SqliteCommand command = connection.CreateCommand();
command.CommandText =
Expand All @@ -31,7 +31,7 @@ private static void UpdateStats(SqliteConnection connection, Stats stats, int pr
UpdateStats(connection, JsonSerializer.Serialize(stats, Utils.s_jsoWithEnumConverterAndIndentation), profileId);
}

public static void UpdateStats(SqliteConnection connection, string stats, int profileId)
private static void UpdateStats(SqliteConnection connection, string stats, int profileId)
{
using SqliteCommand command = connection.CreateCommand();
command.CommandText =
Expand Down
6 changes: 3 additions & 3 deletions JL.Core/Utilities/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ internal static List<string> ListUnicodeCharacters(this ReadOnlySpan<char> text)
if (char.IsHighSurrogate(highSurrogateCandidate)
&& text.Length > i + 1)
{
char lowSurragateCandidate = text[i + 1];
if (char.IsLowSurrogate(lowSurragateCandidate))
char lowSurrogateCandidate = text[i + 1];
if (char.IsLowSurrogate(lowSurrogateCandidate))
{
textBlocks.Add(char.ConvertFromUtf32(char.ConvertToUtf32(highSurrogateCandidate, lowSurragateCandidate)));
textBlocks.Add(char.ConvertFromUtf32(char.ConvertToUtf32(highSurrogateCandidate, lowSurrogateCandidate)));
++i;
}
else
Expand Down
4 changes: 2 additions & 2 deletions JL.Windows/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,14 +1290,14 @@ public static void SaveBeforeClosing()

double mainWindowTopPosition = MainWindow.Instance.Top >= SystemParameters.VirtualScreenTop
? MainWindow.Instance.Top + MainWindow.Instance.Height <= SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight
? (MainWindow.Instance.Top * WindowsUtils.Dpi.DpiScaleY)
? MainWindow.Instance.Top * WindowsUtils.Dpi.DpiScaleY
: Math.Max(SystemParameters.VirtualScreenTop, SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight - MainWindow.Instance.Height) * WindowsUtils.Dpi.DpiScaleY
: WindowsUtils.ActiveScreen.Bounds.Y;
ConfigDBManager.UpdateSetting(connection, "MainWindowTopPosition", mainWindowTopPosition.ToString(CultureInfo.InvariantCulture));

double mainWindowLeftPosition = MainWindow.Instance.Left >= SystemParameters.VirtualScreenLeft
? MainWindow.Instance.Left + MainWindow.Instance.Width <= SystemParameters.VirtualScreenLeft + SystemParameters.VirtualScreenWidth
? (MainWindow.Instance.Left * WindowsUtils.Dpi.DpiScaleX)
? MainWindow.Instance.Left * WindowsUtils.Dpi.DpiScaleX
: Math.Max(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenLeft + SystemParameters.VirtualScreenWidth - MainWindow.Instance.Width) * WindowsUtils.Dpi.DpiScaleX
: WindowsUtils.ActiveScreen.Bounds.X;
ConfigDBManager.UpdateSetting(connection, "MainWindowLeftPosition", mainWindowLeftPosition.ToString(CultureInfo.InvariantCulture));
Expand Down
1 change: 1 addition & 0 deletions JL.Windows/GUI/PopupWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ private void ListViewItem_MouseEnter(object sender, MouseEventArgs e)
}
}

// ReSharper disable once MemberCanBeMadeStatic.Local
private void Unselect(object sender, RoutedEventArgs e)
{
WindowsUtils.Unselect((TextBox)sender);
Expand Down
2 changes: 1 addition & 1 deletion JL.Windows/Utilities/WindowsUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static async Task UpdateJL(Uri latestReleaseUrl)
archive.ExtractToDirectory(tmpDirectory);
}

await Application.Current.Dispatcher.Invoke(async () => await MainWindow.Instance.HandleAppClosing().ConfigureAwait(false)).ConfigureAwait(false);
await Application.Current.Dispatcher.Invoke(static () => MainWindow.Instance.HandleAppClosing()).ConfigureAwait(false);

_ = Process.Start(
new ProcessStartInfo("cmd",
Expand Down

0 comments on commit 92c4927

Please sign in to comment.