diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest b/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest
index 19d2d16..086a5d8 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest
@@ -12,7 +12,7 @@
+ Version="1.0.50.0" />
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs
index 34c668b..da96a41 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs
@@ -84,13 +84,6 @@ namespace BetterLyrics.WinUI3
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
WindowHelper.OpenWindow();
-
- var lyricsWindow = WindowHelper.GetWindowByWindowType();
- if (lyricsWindow != null)
- {
- lyricsWindow.ViewModel.InitLockHotKey();
- lyricsWindow.AutoSelectLyricsMode();
- }
}
private static void ConfigureServices()
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
index 6b3eefa..27bdcf9 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
@@ -70,6 +70,14 @@
+
+
+
+
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/SystemTray.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/SystemTray.xaml
index 9d668b0..70ddd0e 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/SystemTray.xaml
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/SystemTray.xaml
@@ -14,9 +14,9 @@
x:Name="TrayIcon"
x:FieldModifier="public"
ContextMenuMode="SecondWindow"
- DoubleClickCommand="{x:Bind ViewModel.OpenLyricsWindowCommand}"
+ DoubleClickCommand="{x:Bind ViewModel.OpenLyricsCommand}"
IconSource="ms-appx:///Assets/Logo.ico"
- LeftClickCommand="{x:Bind ViewModel.OpenLyricsWindowCommand}"
+ LeftClickCommand="{x:Bind ViewModel.OpenLyricsCommand}"
NoLeftClickDelay="True"
ToolTipText="{x:Bind ViewModel.ToolTipText, Mode=OneWay}">
@@ -24,6 +24,10 @@
AreOpenCloseAnimationsEnabled="True"
LightDismissOverlayMode="On"
ShowMode="TransientWithDismissOnPointerMoveAway">
+
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/ValueTransition.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/ValueTransition.cs
index 3e6b09d..4ff058c 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/ValueTransition.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/ValueTransition.cs
@@ -46,7 +46,7 @@ namespace BetterLyrics.WinUI3.Helper
}
else
{
- _easingType = Enums.EasingType.Linear;
+ _easingType = Enums.EasingType.EaseInOutQuad;
_interpolator = GetInterpolatorByEasingType(_easingType.Value);
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/WindowHelper.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/WindowHelper.cs
index ecaa7ae..7cc3c98 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/WindowHelper.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/WindowHelper.cs
@@ -18,6 +18,10 @@ namespace BetterLyrics.WinUI3.Helper
public static void CloseWindow()
{
+ if (typeof(T) == typeof(LyricsWindow))
+ {
+ EnsureDockModeReleased();
+ }
var window = _activeWindows.Find(w => w is T);
if (window is Window w)
{
@@ -64,6 +68,13 @@ namespace BetterLyrics.WinUI3.Helper
var castedWindow = (Window)window;
castedWindow.Restore();
castedWindow.Activate();
+
+ if (typeof(T) == typeof(LyricsWindow))
+ {
+ var lyricsWindow = (LyricsWindow)window;
+ lyricsWindow.ViewModel.InitLockHotKey();
+ lyricsWindow.AutoSelectLyricsMode();
+ }
}
public static void RestartApp(string args = "")
@@ -88,12 +99,17 @@ namespace BetterLyrics.WinUI3.Helper
public static void ExitApp()
{
- LyricsWindow? lyricsWindow = WindowHelper.GetWindowByWindowType();
+ EnsureDockModeReleased();
+ Environment.Exit(0);
+ }
+
+ private static void EnsureDockModeReleased()
+ {
+ LyricsWindow? lyricsWindow = GetWindowByWindowType();
if (lyricsWindow != null)
{
DockModeHelper.Disable(lyricsWindow);
}
- Environment.Exit(0);
}
private static void TrackWindow(object window)
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsLine.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsLine.cs
index abdd4fd..7f567dc 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsLine.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsLine.cs
@@ -25,32 +25,32 @@ namespace BetterLyrics.WinUI3.Models
public ValueTransition AngleTransition { get; set; } = new(
initialValue: 0,
durationSeconds: _animationDuration,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public ValueTransition BlurAmountTransition { get; set; } = new(
initialValue: 0,
durationSeconds: _animationDuration,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public ValueTransition HighlightOpacityTransition { get; set; } = new(
initialValue: 0,
durationSeconds: _animationDuration,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public ValueTransition OpacityTransition { get; set; } = new(
initialValue: 0,
durationSeconds: _animationDuration,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public ValueTransition ScaleTransition { get; set; } = new(
initialValue: 0.75,
durationSeconds: _animationDuration,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public ValueTransition YOffsetTransition { get; set; } = new(
initialValue: 0,
durationSeconds: 0.5,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
public CanvasTextLayout? CanvasTextLayout { get; private set; }
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
index bf69049..0c41444 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
@@ -9,13 +9,14 @@ namespace BetterLyrics.WinUI3.Models.Settings
public partial class AppSettings : ObservableRecipient
{
public string Version { get; set; } = Helper.MetadataHelper.AppVersion;
+
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsStyleSettings StandardLyricsStyleSettings { get; set; } = new LyricsStyleSettings(32, TextAlignmentType.Left, 0);
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsStyleSettings DesktopLyricsStyleSettings { get; set; } = new LyricsStyleSettings(28, TextAlignmentType.Center, 2);
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsStyleSettings DockLyricsStyleSettings { get; set; } = new LyricsStyleSettings(16, TextAlignmentType.Center, 0);
- [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings StandardLyricsEffectSettings { get; set; } = new LyricsEffectSettings(100, 500, 1000, EasingType.EaseInOutSine);
- [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings DesktopLyricsEffectSettings { get; set; } = new LyricsEffectSettings(500, 500, 500, EasingType.EaseInOutSine);
- [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings DockLyricsEffectSettings { get; set; } = new LyricsEffectSettings(500, 500, 500, EasingType.EaseInOutSine);
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings StandardLyricsEffectSettings { get; set; } = new LyricsEffectSettings(100, 500, 1000, EasingType.EaseInOutQuad);
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings DesktopLyricsEffectSettings { get; set; } = new LyricsEffectSettings(500, 500, 500, EasingType.EaseInOutQuad);
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings DockLyricsEffectSettings { get; set; } = new LyricsEffectSettings(500, 500, 500, EasingType.EaseInOutQuad);
[ObservableProperty][NotifyPropertyChangedRecipients] public partial StandardModeSettings StandardModeSettings { get; set; } = new StandardModeSettings();
[ObservableProperty][NotifyPropertyChangedRecipients] public partial DesktopModeSettings DesktopModeSettings { get; set; } = new DesktopModeSettings();
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/GeneralSettings.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/GeneralSettings.cs
index 3f2fcf1..5167807 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/GeneralSettings.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/GeneralSettings.cs
@@ -18,6 +18,7 @@ namespace BetterLyrics.WinUI3.Models.Settings
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsDragEverywhereEnabled { get; set; } = false;
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsDisplayType DisplayType { get; set; } = LyricsDisplayType.SplitView;
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsImmersiveMode { get; set; } = false;
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial bool ExitOnLyricsWindowClosed { get; set; } = true;
public GeneralSettings() { }
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/AlbumArtSearchService/AlbumArtSearchService.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/AlbumArtSearchService/AlbumArtSearchService.cs
index 25dd93b..46d0f69 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/AlbumArtSearchService/AlbumArtSearchService.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/AlbumArtSearchService/AlbumArtSearchService.cs
@@ -72,19 +72,21 @@ namespace BetterLyrics.WinUI3.Services.AlbumArtSearchService
{
foreach (var file in Directory.GetFiles(folder.Path, $"*.*", SearchOption.AllDirectories))
{
- try
+ if (FileHelper.IsSwitchableNormalizedMatch(Path.GetFileNameWithoutExtension(file), artist, title))
{
- Track track = new(file);
- if (track.Artist == artist && track.Title == title)
+ try
{
+ Track track = new(file);
var bytes = track.EmbeddedPictures.FirstOrDefault()?.PictureData;
if (bytes != null)
{
return bytes;
}
}
+ catch (Exception)
+ {
+ }
}
- catch (Exception) { }
}
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LyricsSearchService/LyricsSearchService.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LyricsSearchService/LyricsSearchService.cs
index 59c08d6..df83e05 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LyricsSearchService/LyricsSearchService.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LyricsSearchService/LyricsSearchService.cs
@@ -197,19 +197,20 @@ namespace BetterLyrics.WinUI3.Services.LyricsSearchService
{
foreach (var file in Directory.GetFiles(folder.Path, $"*.*", SearchOption.AllDirectories))
{
- try
+ if (FileHelper.IsSwitchableNormalizedMatch(Path.GetFileNameWithoutExtension(file), title, artist))
{
- Track track = new(file);
- if (track.Artist == artist && track.Title == title)
+ try
{
var plain = TagLib.File.Create(file).Tag.Lyrics;
- if (plain != null && plain != string.Empty)
+ if (!plain.IsNullOrEmpty())
{
return plain;
}
}
+ catch (Exception)
+ {
+ }
}
- catch (Exception) { }
}
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
index d0b51e7..4d1a3a3 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
@@ -562,6 +562,9 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
English
+
+ Exit the program when you close the lyrics window
+
Export settings
@@ -973,6 +976,9 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
Exit
+
+ Open the lyrics window
+
Open music gallery
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
index 57fe65f..85cbe49 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
@@ -562,6 +562,9 @@
English
+
+ 歌詞ウィンドウを閉じてプログラムを終了してください
+
エクスポート設定
@@ -973,6 +976,9 @@
プログラムを終了します
+
+ 歌詞ウィンドウを開きます
+
オープンミュージックギャラリー
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
index 36c97e8..b560702 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
@@ -562,6 +562,9 @@
English
+
+ 가사 창을 닫으면 프로그램을 종료하세요
+
내보내기 설정
@@ -973,6 +976,9 @@
프로그램을 종료하십시오
+
+ 가사 창을 여세요
+
오픈 음악 갤러리
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
index 7868155..791feed 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
@@ -562,6 +562,9 @@
English
+
+ 关闭歌词窗口时退出程序
+
导出设置
@@ -973,6 +976,9 @@
退出程序
+
+ 打开歌词窗口
+
打开音乐库
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
index 9f5f628..17d65b4 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
@@ -562,6 +562,9 @@
English
+
+ 關閉歌詞視窗時退出程式
+
導出設置
@@ -973,6 +976,9 @@
退出程序
+
+ 開啟歌詞視窗
+
開啟音樂庫
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Transition.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Transition.cs
index d74d67e..9f0d36f 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Transition.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Transition.cs
@@ -15,7 +15,7 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
private readonly ValueTransition _canvasYScrollTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutSine
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _immersiveBgColorTransition = new(
@@ -38,25 +38,25 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
private readonly ValueTransition _titleXTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _titleYTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _lyricsXTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _lyricsYTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _lyricsOpacityTransition = new(
@@ -77,13 +77,13 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
private readonly ValueTransition _albumArtXTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _albumArtYTransition = new(
initialValue: 0f,
durationSeconds: 0.3f,
- easingType: EasingType.EaseInOutBack
+ easingType: EasingType.EaseInOutQuad
);
private readonly ValueTransition _songInfoOpacityTransition = new(
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs
index bc333a4..90f9da0 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs
@@ -254,6 +254,18 @@ namespace BetterLyrics.WinUI3
ActivatedWindowAccentColor = ColorHelper.GetAccentColor(hwnd, _settingsService.AppSettings.DockModeSettings.DockMonitorDeviceName, mode).ToColor();
}
+ public void ExitOrClose()
+ {
+ if (_settingsService.AppSettings.GeneralSettings.ExitOnLyricsWindowClosed)
+ {
+ WindowHelper.ExitApp();
+ }
+ else
+ {
+ WindowHelper.CloseWindow();
+ }
+ }
+
public void InitLockHotKey()
{
UpdateLockHotKey(_settingsService.AppSettings.DesktopModeSettings.LockHotKeyIndex);
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SystemTrayViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SystemTrayViewModel.cs
index fe2e453..62cf54b 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SystemTrayViewModel.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SystemTrayViewModel.cs
@@ -71,7 +71,7 @@ namespace BetterLyrics.WinUI3.ViewModels
}
[RelayCommand]
- private static void OpenLyricsWindow()
+ private static void OpenLyrics()
{
WindowHelper.OpenWindow();
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
index 8a836be..a9644b0 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
@@ -42,7 +42,7 @@ namespace BetterLyrics.WinUI3.Views
private void AppWindow_Closing(AppWindow sender, AppWindowClosingEventArgs args)
{
- WindowHelper.ExitApp();
+ ViewModel.ExitOrClose();
}
public void UpdateTitleBarArea()
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/MusicGalleryWindow.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/MusicGalleryWindow.xaml.cs
index a193240..e2e41ca 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/MusicGalleryWindow.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/MusicGalleryWindow.xaml.cs
@@ -34,6 +34,12 @@ namespace BetterLyrics.WinUI3.Views
AppWindow.TitleBar.PreferredTheme = TitleBarTheme.UseDefaultAppMode;
AppWindow.SetIcons();
+ AppWindow.Closing += AppWindow_Closing;
+ }
+
+ private void AppWindow_Closing(AppWindow sender, AppWindowClosingEventArgs args)
+ {
+ WindowHelper.CloseWindow();
}
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsWindow.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsWindow.xaml.cs
index 6ab214a..46dca8c 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsWindow.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsWindow.xaml.cs
@@ -18,9 +18,16 @@ namespace BetterLyrics.WinUI3.Views
AppWindow.TitleBar.PreferredTheme = TitleBarTheme.UseDefaultAppMode;
AppWindow.SetIcons();
+ AppWindow.Closing += AppWindow_Closing;
+
RootFrame.Navigate(typeof(SettingsPage));
}
+ private void AppWindow_Closing(AppWindow sender, AppWindowClosingEventArgs args)
+ {
+ WindowHelper.CloseWindow();
+ }
+
private void TipContainerCenter_Loaded(object sender, RoutedEventArgs e)
{
App.Current.SettingsWindowNotificationPanel = TipContainerCenter;