diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml
index ea0a51b..2e128b6 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml
@@ -58,6 +58,7 @@
+
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AlbumArtLayoutSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AlbumArtLayoutSettingsControl.xaml
index e41f721..e84f02a 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AlbumArtLayoutSettingsControl.xaml
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AlbumArtLayoutSettingsControl.xaml
@@ -46,6 +46,15 @@
+
+
+
+
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
index e4bd23a..a047512 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml
@@ -62,6 +62,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml.cs
index 49ba46b..72138c2 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml.cs
@@ -1,5 +1,8 @@
+using BetterLyrics.WinUI3.Helper;
+using BetterLyrics.WinUI3.Models;
using BetterLyrics.WinUI3.Models.Settings;
using BetterLyrics.WinUI3.ViewModels;
+using BetterLyrics.WinUI3.Views;
using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -46,5 +49,33 @@ namespace BetterLyrics.WinUI3.Controls
{
AutoStartupToggleSwitch.Toggled -= AutoStartupToggleSwitch_Toggled;
}
+
+ private void DeleteWindowBoundsRecordButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (sender is Button button)
+ {
+ var data = button.DataContext as WindowBoundsRecord;
+ if (data != null)
+ {
+ ViewModel.AppSettings.WindowBoundsRecords.Remove(data);
+ }
+ }
+ }
+
+ private void ApplyWindowBoundsRecordButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (sender is Button button)
+ {
+ var data = button.DataContext as WindowBoundsRecord;
+ if (data != null)
+ {
+ var lyricsWindow = WindowHelper.GetWindowByWindowType();
+ if (lyricsWindow != null)
+ {
+ lyricsWindow.AppWindow.MoveAndResize(data.WindowBounds.ToRectInt32());
+ }
+ }
+ }
+ }
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/RectToMarginConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/RectToMarginConverter.cs
new file mode 100644
index 0000000..34e5954
--- /dev/null
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/RectToMarginConverter.cs
@@ -0,0 +1,26 @@
+using Microsoft.UI.Xaml.Data;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BetterLyrics.WinUI3.Converter
+{
+ public class RectToMarginConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ if (value is Windows.Foundation.Rect rect)
+ {
+ return new Microsoft.UI.Xaml.Thickness(rect.X, rect.Y, 0, 0);
+ }
+ return new Microsoft.UI.Xaml.Thickness(0);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/MonitorHelper.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/MonitorHelper.cs
index 0f69141..eb28033 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/MonitorHelper.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/MonitorHelper.cs
@@ -1,4 +1,5 @@
-using System;
+using Microsoft.UI.Xaml;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
@@ -6,6 +7,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Vanara.PInvoke;
+using WinRT.Interop;
namespace BetterLyrics.WinUI3.Helper
{
@@ -60,5 +62,14 @@ namespace BetterLyrics.WinUI3.Helper
var primaryMonitorInfo = GetPrimaryMonitorInfoEx();
return primaryMonitorInfo.szDevice;
}
+
+ public static User32.MONITORINFOEX GetMonitorInfoExFromWindow(Window window)
+ {
+ var hwnd = WindowNative.GetWindowHandle(window);
+ var hMonitor = User32.MonitorFromWindow(hwnd, User32.MonitorFlags.MONITOR_DEFAULTTONEAREST);
+ User32.MONITORINFOEX monitorInfoEx = new() { cbSize = (uint)Marshal.SizeOf() };
+ User32.GetMonitorInfo(hMonitor, ref monitorInfoEx);
+ return monitorInfoEx;
+ }
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LiveStates.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LiveStates.cs
index de97157..acdb30c 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LiveStates.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LiveStates.cs
@@ -1,4 +1,5 @@
using BetterLyrics.WinUI3.Enums;
+using BetterLyrics.WinUI3.Helper;
using BetterLyrics.WinUI3.Models.Settings;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
@@ -6,6 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Vanara.PInvoke;
+using Windows.Foundation;
namespace BetterLyrics.WinUI3.Models
{
@@ -16,6 +19,11 @@ namespace BetterLyrics.WinUI3.Models
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsAlwaysOnTop { get; set; }
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsStyleSettings LyricsStyleSettings { get; set; }
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsEffectSettings LyricsEffectSettings { get; set; }
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial Rect LyricsWindowBounds { get; set; }
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial Rect LyricsWindowMonitorBounds { get; set; }
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial Rect DemoLyricsWindowBounds { get; set; }
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial Rect DemoLyricsWindowMonitorBounds { get; set; }
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial string LyricsWindowMonitorName { get; set; }
public LiveStates(AppSettings appSettings)
{
@@ -37,5 +45,32 @@ namespace BetterLyrics.WinUI3.Models
LyricsWindowMode = mode;
}
}
+
+ partial void OnLyricsWindowBoundsChanged(Rect value)
+ {
+ double factor = 0.1;
+ DemoLyricsWindowBounds = new Rect(
+ value.X * factor,
+ value.Y * factor,
+ value.Width * factor,
+ value.Height * factor
+ );
+ var lyricsWindow = WindowHelper.GetWindowByWindowType();
+ if (lyricsWindow == null) return;
+ var mointor = MonitorHelper.GetMonitorInfoExFromWindow(lyricsWindow);
+ LyricsWindowMonitorName = mointor.szDevice;
+ LyricsWindowMonitorBounds = new Rect(
+ mointor.rcWork.Left,
+ mointor.rcWork.Top,
+ mointor.rcWork.Width,
+ mointor.rcWork.Height
+ );
+ DemoLyricsWindowMonitorBounds = new Rect(
+ mointor.rcWork.Left * factor,
+ mointor.rcWork.Top * factor,
+ mointor.rcWork.Width * factor,
+ mointor.rcWork.Height * factor
+ );
+ }
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AlbumArtLayoutSettings.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AlbumArtLayoutSettings.cs
index 286d4c9..c1d2ea6 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AlbumArtLayoutSettings.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AlbumArtLayoutSettings.cs
@@ -13,6 +13,7 @@ namespace BetterLyrics.WinUI3.Models.Settings
[ObservableProperty][NotifyPropertyChangedRecipients] public partial TextAlignmentType SongInfoAlignmentType { get; set; } = TextAlignmentType.Left;
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int CoverImageRadius { get; set; } = 12; // 12 % of the cover image size
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int CoverImageShadowAmount { get; set; } = 12;
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial int SongInfoFontSize { get; set; } = 18;
public AlbumArtLayoutSettings() { }
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
index a6753de..e9f24a3 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/Settings/AppSettings.cs
@@ -34,8 +34,8 @@ namespace BetterLyrics.WinUI3.Models.Settings
[ObservableProperty][NotifyPropertyChangedRecipients] public partial FullyObservableCollection LocalMediaFolders { get; set; } = [];
[ObservableProperty][NotifyPropertyChangedRecipients] public partial FullyObservableCollection MediaSourceProvidersInfo { get; set; } = [];
-
[ObservableProperty][NotifyPropertyChangedRecipients] public partial FullyObservableCollection MappedSongSearchQueries { get; set; } = [];
+ [ObservableProperty][NotifyPropertyChangedRecipients] public partial FullyObservableCollection WindowBoundsRecords { get; set; } = [];
public AppSettings() { }
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/WindowBoundsRecord.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/WindowBoundsRecord.cs
new file mode 100644
index 0000000..196f0a8
--- /dev/null
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/WindowBoundsRecord.cs
@@ -0,0 +1,19 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.Foundation;
+
+namespace BetterLyrics.WinUI3.Models
+{
+ public partial class WindowBoundsRecord : ObservableObject
+ {
+ [ObservableProperty] public partial string MonitorDeviceName { get; set; } = string.Empty;
+ [ObservableProperty] public partial Rect WindowBounds { get; set; }
+ [ObservableProperty] public partial Rect DemoWindowBounds { get; set; }
+ [ObservableProperty] public partial Rect MonitorBounds { get; set; }
+ [ObservableProperty] public partial Rect DemoMonitorBounds { get; set; }
+ }
+}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/SettingsService/SettingsService.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/SettingsService/SettingsService.cs
index 88dd932..18e947a 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/SettingsService/SettingsService.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/SettingsService/SettingsService.cs
@@ -60,6 +60,9 @@ namespace BetterLyrics.WinUI3.Services.SettingsService
AppSettings.MappedSongSearchQueries.CollectionChanged += AppSettings_CollectionChanged;
AppSettings.MappedSongSearchQueries.ItemPropertyChanged += AppSettings_ItemPropertyChanged;
+ AppSettings.WindowBoundsRecords.CollectionChanged += AppSettings_CollectionChanged;
+ AppSettings.WindowBoundsRecords.ItemPropertyChanged += AppSettings_ItemPropertyChanged;
+
AppSettings.Version = MetadataHelper.AppVersion;
EnsureMediaSourceProvidersInfo();
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
index cf8e5be..220b535 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw
@@ -499,6 +499,9 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
App behavior
+
+ Apply
+
Auto-lock when activating desktop mode
@@ -544,12 +547,18 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
Compact
+
+ Current lyrics window status
+
Dark
Show debug overlay
+
+ Delete
+
Desktop Acrylic
@@ -904,6 +913,9 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
Top and bottom edge opacity
+
+ Lyrics window manager
+
Media library
@@ -973,6 +985,12 @@ If you encounter any problems, please go to the Settings page, About tab, and vi
QQ feedback & chat group
+
+ Record
+
+
+ Recorded window status
+
Original files and folders in this path will not be deleted when removing it from this app
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
index 8f3a94f..a7b4e04 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw
@@ -499,6 +499,9 @@
アプリの動作
+
+ 適用する
+
デスクトップモードをアクティブにするときの自動ロック
@@ -544,12 +547,18 @@
コンパクト
+
+ 現在の歌詞ウィンドウステータス
+
暗い
デバッグオーバーレイを表示します
+
+ 消去
+
デスクトップアクリル
@@ -904,6 +913,9 @@
上端と下端の不透明度
+
+ 歌詞ウィンドウマネージャー
+
メディアライブラリ
@@ -973,6 +985,12 @@
QQフィードバック&チャットグループ
+
+ 記録
+
+
+ 記録されたウィンドウステータス
+
このパスの元のファイルとフォルダーは、このアプリから削除するときに削除されません
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
index 5238aba..1a03bff 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw
@@ -499,6 +499,9 @@
앱 동작
+
+ 적용하다
+
데스크탑 모드를 활성화 할 때 자동 잠금
@@ -544,12 +547,18 @@
콤팩트
+
+ 현재 가사 창 상태
+
어두운
디버그 오버레이를 표시하십시오
+
+ 삭제
+
데스크탑 아크릴
@@ -904,6 +913,9 @@
상단 및 하단 가장자리 불투명도
+
+ 가사 창 관리자
+
미디어 라이브러리
@@ -973,6 +985,12 @@
QQ 피드백 및 채팅 그룹
+
+ 기록
+
+
+ 기록 된 창 상태
+
이 경로의 원본 파일과 폴더는이 앱에서 제거 할 때 삭제되지 않습니다.
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
index 8e671d8..5dda332 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw
@@ -499,6 +499,9 @@
应用行为
+
+ 应用
+
启动桌面模式时随即锁定窗口
@@ -544,12 +547,18 @@
紧凑
+
+ 当前歌词窗口状态
+
深色
显示调试覆盖层
+
+ 删除
+
亚克力(桌面)
@@ -904,6 +913,9 @@
上下边缘不透明度
+
+ 歌词窗口管理
+
媒体库
@@ -973,6 +985,12 @@
QQ 反馈交流群
+
+ 记录
+
+
+ 记录的窗口状态
+
路径中的原始文件和文件夹不会被删除
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
index 88f6a76..725065d 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw
@@ -499,6 +499,9 @@
應用行為
+
+ 應用
+
啟動桌面模式時隨即鎖定窗口
@@ -544,12 +547,18 @@
緊湊
+
+ 當前歌詞窗口狀態
+
深色
顯示調試覆蓋層
+
+ 刪除
+
亞克力(桌面)
@@ -904,6 +913,9 @@
上下邊緣不透明度
+
+ 歌詞視窗管理
+
媒體庫
@@ -973,6 +985,12 @@
QQ 回饋交流群
+
+ 記錄
+
+
+ 記錄的窗口狀態
+
路徑中的原始檔案和資料夾不會被刪除
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/AppSettingsControlViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/AppSettingsControlViewModel.cs
index e5b1e30..e2876f1 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/AppSettingsControlViewModel.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/AppSettingsControlViewModel.cs
@@ -1,5 +1,7 @@
using BetterLyrics.WinUI3.Helper;
+using BetterLyrics.WinUI3.Models;
using BetterLyrics.WinUI3.Models.Settings;
+using BetterLyrics.WinUI3.Services.LiveStatesService;
using BetterLyrics.WinUI3.Services.SettingsService;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -13,19 +15,25 @@ namespace BetterLyrics.WinUI3.ViewModels
public partial class AppSettingsControlViewModel : BaseViewModel
{
private readonly ISettingsService _settingsService;
+ private readonly ILiveStatesService _liveStatesService;
[ObservableProperty]
public partial AppSettings AppSettings { get; set; }
+ [ObservableProperty]
+ public partial LiveStates LiveStates { get; set; }
+
[ObservableProperty]
public partial ObservableCollection MonitorDeviceNames { get; set; }
- public AppSettingsControlViewModel(ISettingsService settingsService)
+ public AppSettingsControlViewModel(ISettingsService settingsService, ILiveStatesService liveStatesService)
{
_settingsService = settingsService;
+ _liveStatesService = liveStatesService;
MonitorDeviceNames = [.. MonitorHelper.GetAllMonitorDeviceNames()];
AppSettings = _settingsService.AppSettings;
+ LiveStates = _liveStatesService.LiveStates;
}
[RelayCommand]
@@ -41,6 +49,19 @@ namespace BetterLyrics.WinUI3.ViewModels
AppSettings.DockModeSettings.DockMonitorDeviceName = MonitorHelper.GetPrimaryMonitorDeviceName();
}
+ [RelayCommand]
+ private void RecordCurrentWindowBounds()
+ {
+ AppSettings.WindowBoundsRecords.Add(new WindowBoundsRecord
+ {
+ WindowBounds = LiveStates.LyricsWindowBounds,
+ MonitorDeviceName = LiveStates.LyricsWindowMonitorName,
+ MonitorBounds = LiveStates.LyricsWindowMonitorBounds,
+ DemoWindowBounds = LiveStates.DemoLyricsWindowBounds,
+ DemoMonitorBounds = LiveStates.DemoLyricsWindowMonitorBounds
+ });
+ }
+
public async Task ToggleAutoStartupAsync(bool target)
{
StartupTask startupTask = await StartupTask.GetAsync(Constants.App.AutoStartupTaskId);
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Messages.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Messages.cs
index ed9b4ac..a497c52 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Messages.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Messages.cs
@@ -133,6 +133,10 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
{
_isAlbumArtShadowAmountChanged = true;
}
+ else if (message.PropertyName == nameof(AlbumArtLayoutSettings.SongInfoFontSize))
+ {
+ UpdateSongInfoFontSize();
+ }
}
else if (message.Sender is LyricsBackgroundSettings)
{
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Update.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Update.cs
index e959262..cfe9142 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Update.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.Update.cs
@@ -328,7 +328,7 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
if (_liveStatesService.LiveStates.LyricsStyleSettings.IsDynamicLyricsFontSize)
{
- _lyricsTextFormat.FontSize = (float)Math.Max(12, Math.Min(_canvasHeight, _canvasWidth) / 10);
+ _lyricsTextFormat.FontSize = (float)Math.Clamp(Math.Min(_canvasHeight, _canvasWidth) / 10, 12, 72);
}
else
{
@@ -695,5 +695,11 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
var current = _mediaSessionsService.GetCurrentMediaSourceProviderInfo();
_isLastFMTrackEnabled = current?.IsLastFMTrackEnabled ?? false;
}
+
+ private void UpdateSongInfoFontSize()
+ {
+ _titleTextFormat.FontSize = _settingsService.AppSettings.AlbumArtLayoutSettings.SongInfoFontSize;
+ _artistTextFormat.FontSize = _settingsService.AppSettings.AlbumArtLayoutSettings.SongInfoFontSize - 2;
+ }
}
}
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.cs
index d10c8d0..bae4448 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel/LyricsRendererViewModel.cs
@@ -190,6 +190,8 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
AppSettings = _settingsService.AppSettings;
_titleTextFormat.HorizontalAlignment = _artistTextFormat.HorizontalAlignment = _settingsService.AppSettings.AlbumArtLayoutSettings.SongInfoAlignmentType.ToCanvasHorizontalAlignment();
+ UpdateSongInfoFontSize();
+
_timelineSyncThreshold = 0;
diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
index 9652180..421346e 100644
--- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
+++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs
@@ -2,6 +2,7 @@
using BetterLyrics.WinUI3.Enums;
using BetterLyrics.WinUI3.Helper;
+using BetterLyrics.WinUI3.Services.LiveStatesService;
using BetterLyrics.WinUI3.Services.SettingsService;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.WinUI;
@@ -19,6 +20,7 @@ namespace BetterLyrics.WinUI3.Views
public sealed partial class LyricsWindow : Window
{
private readonly ISettingsService _settingsService = Ioc.Default.GetRequiredService();
+ private readonly ILiveStatesService _liveStatesService = Ioc.Default.GetRequiredService();
private readonly WindowMessageMonitor _wmm;
private bool _autoSelectLyricsModeOnRunning = true;
@@ -101,6 +103,11 @@ namespace BetterLyrics.WinUI3.Views
break;
}
_autoSelectLyricsModeOnRunning = false;
+
+ var size = AppWindow.Size;
+ var rect = AppWindow.Position;
+
+ _liveStatesService.LiveStates.LyricsWindowBounds = new Windows.Foundation.Rect(rect.X, rect.Y, size.Width, size.Height);
}
private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args)
@@ -112,6 +119,8 @@ namespace BetterLyrics.WinUI3.Views
var size = AppWindow.Size;
var rect = AppWindow.Position;
+ _liveStatesService.LiveStates.LyricsWindowBounds = new Windows.Foundation.Rect(rect.X, rect.Y, size.Width, size.Height);
+
if (rect.X < 0 && rect.Y < 0 && rect.X + size.Width < 0 && rect.Y + size.Height < 0)
{
return;