From 133acf5592914999589715d8b7d89738ac1430e7 Mon Sep 17 00:00:00 2001 From: Zhe Fang Date: Sat, 16 Aug 2025 11:36:52 -0400 Subject: [PATCH] add display type settings for every mode --- .../BetterLyrics.WinUI3.csproj | 1 + .../Controls/AppSettingsControl.xaml | 40 ++++++++++++++++ .../LiveStatesService/LiveStatesService.cs | 47 ++++++++++++++++++- .../Strings/en-US/Resources.resw | 15 +++--- .../Strings/ja-JP/Resources.resw | 15 +++--- .../Strings/ko-KR/Resources.resw | 15 +++--- .../Strings/zh-CN/Resources.resw | 15 +++--- .../Strings/zh-TW/Resources.resw | 15 +++--- .../ViewModels/LyricsWindowViewModel.cs | 6 +++ .../BetterLyrics.WinUI3/Views/LyricsPage.xaml | 28 ----------- .../Views/LyricsPage.xaml.cs | 5 -- .../Views/LyricsWindow.xaml.cs | 1 + 12 files changed, 139 insertions(+), 64 deletions(-) diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj index 7424737..f0d0dab 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj @@ -58,6 +58,7 @@ + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml index 1867d8a..9e96f7e 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml @@ -74,10 +74,30 @@ + + + + + + + + + + + + + + + + + + + + @@ -123,6 +143,14 @@ + + + + + + + + @@ -152,6 +180,18 @@ + + + + + + + + + + + + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LiveStatesService/LiveStatesService.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LiveStatesService/LiveStatesService.cs index 2a0cae6..c0ebd6b 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LiveStatesService/LiveStatesService.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/LiveStatesService/LiveStatesService.cs @@ -14,7 +14,8 @@ using System.Threading.Tasks; namespace BetterLyrics.WinUI3.Services.LiveStatesService { public class LiveStatesService : BaseViewModel, ILiveStatesService, - IRecipient> + IRecipient>, + IRecipient> { private readonly ISettingsService _settingsService; @@ -61,5 +62,49 @@ namespace BetterLyrics.WinUI3.Services.LiveStatesService } } } + + public void Receive(PropertyChangedMessage message) + { + if (message.Sender is StandardModeSettings) + { + if (message.PropertyName == nameof(StandardModeSettings.LyricsDisplayType)) + { + if (LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.StandardMode) + { + LiveStates.CurrentLyricsDisplayType = message.NewValue; + } + } + } + else if (message.Sender is DockModeSettings) + { + if (message.PropertyName == nameof(DockModeSettings.LyricsDisplayType)) + { + if (LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.DockMode) + { + LiveStates.CurrentLyricsDisplayType = message.NewValue; + } + } + } + else if (message.Sender is DesktopModeSettings) + { + if (message.PropertyName == nameof(DesktopModeSettings.LyricsDisplayType)) + { + if (LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.DesktopMode) + { + LiveStates.CurrentLyricsDisplayType = message.NewValue; + } + } + } + else if (message.Sender is PictureInPictureModeSettings) + { + if (message.PropertyName == nameof(PictureInPictureModeSettings.LyricsDisplayType)) + { + if (LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.PictureInPictureMode) + { + LiveStates.CurrentLyricsDisplayType = message.NewValue; + } + } + } + } } } diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw index 04627d5..e833316 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw @@ -219,9 +219,6 @@ Lyrics not found - - Display type - Lyrics provider @@ -276,9 +273,6 @@ Switch to desktop lyrics mode - - Change display type - Hover back again to show the toggle button @@ -463,6 +457,12 @@ If you encounter any problems, please go to the Settings page, About tab, and vi Dock mode + + Picture-in-picture mode + + + Standard + Auto-lock when activating desktop mode @@ -514,6 +514,9 @@ If you encounter any problems, please go to the Settings page, About tab, and vi Discord + + Lyrics album layout mode + Target monitor diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw index 94ae42d..d3f8c82 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw @@ -219,9 +219,6 @@ 歌詞が見つかりません - - 表示タイプ - 歌詞プロバイダー @@ -276,9 +273,6 @@ デスクトップ歌詞モードに切り替えます - - 表示タイプを変更します - 再びホバリングして、トグルボタンを表示します @@ -463,6 +457,12 @@ ドックモード + + ピクチャーインピクチャーモード + + + 標準モード + デスクトップモードをアクティブにするときの自動ロック @@ -514,6 +514,9 @@ Discord + + 歌詞アルバムレイアウトモード + ターゲットモニター diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw index e6bc0a7..f94689e 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw @@ -219,9 +219,6 @@ 가사를 찾을 수 없습니다 - - 디스플레이 유형 - 가사 제공자 @@ -276,9 +273,6 @@ 데스크탑 가사 모드로 전환하십시오 - - 디스플레이 유형을 변경하십시오 - 토글 버튼을 표시하려면 다시 다시 가져옵니다 @@ -463,6 +457,12 @@ 도크 모드 + + 사진 인당 모드 + + + 표준 모드 + 데스크탑 모드를 활성화 할 때 자동 잠금 @@ -514,6 +514,9 @@ Discord + + 가사 앨범 레이아웃 모드 + 대상 모니터 diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw index b0952cb..5457f2a 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw @@ -219,9 +219,6 @@ 未找到歌词 - - 显示类型 - 歌词来源 @@ -276,9 +273,6 @@ 切换到桌面歌词模式 - - 切换显示模式 - 再次悬停以显示切换按钮 @@ -463,6 +457,12 @@ 停靠模式 + + 画中画模式 + + + 标准模式 + 启动桌面模式时随即锁定窗口 @@ -514,6 +514,9 @@ Discord + + 歌词专辑布局模式 + 目标显示器 diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw index 27f9925..4c15459 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw @@ -219,9 +219,6 @@ 找不到歌詞 - - 顯示類型 - 歌詞來源 @@ -276,9 +273,6 @@ 切換到桌面歌詞模式 - - 切換顯示模式 - 再次懸停以顯示切換按鈕 @@ -463,6 +457,12 @@ 停靠模式 + + 畫中畫模式 + + + 標準模式 + 啟動桌面模式時隨即鎖定窗口 @@ -514,6 +514,9 @@ Discord + + 歌詞專輯佈局模式 + 目標顯示器 diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs index 4f6d00d..6a08ff3 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsWindowViewModel.cs @@ -337,6 +337,12 @@ namespace BetterLyrics.WinUI3 UpdateDockOrDesktopWindow(); } + [RelayCommand] + private void TogglePictureInPictureMode() + { + LiveStates.ToggleLyricsWindowMode(LyricsWindowMode.PictureInPictureMode); + } + [RelayCommand] private void OnImmersiveToggleButtonEnabledChanged() { diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml index dc38674..9bffa42 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml @@ -256,34 +256,6 @@ - - -