diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest b/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest index 93d5c20..8077198 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/Package.appxmanifest @@ -12,7 +12,7 @@ + Version="1.0.53.0" /> diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml index 99c3653..bbed9d9 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml @@ -10,10 +10,10 @@ + - @@ -54,6 +54,7 @@ + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj index f0d0dab..5ab5f88 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj @@ -30,6 +30,7 @@ + @@ -58,7 +59,6 @@ - @@ -186,6 +186,11 @@ Always + + + MSBuild:Compile + + MSBuild:Compile diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml index 9e96f7e..c40ce82 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/AppSettingsControl.xaml @@ -90,6 +90,10 @@ + + + + @@ -103,46 +107,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + @@ -184,6 +159,10 @@ + + + + @@ -192,6 +171,22 @@ + + + + + + + + + + + + + + + + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/LyricsBavkgroundSettingsControl.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/LyricsBavkgroundSettingsControl.xaml index a03eac0..73ccbdd 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/LyricsBavkgroundSettingsControl.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Controls/LyricsBavkgroundSettingsControl.xaml @@ -55,7 +55,7 @@ Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.CoverOverlaySpeed, Mode=TwoWay}" /> - + - + - + - - + + + + + + + + + + + + + + + + - - + + - - - - - - + + + + + + + + + + + + + - - - + + - + + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs index 24685af..906918f 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsWindow.xaml.cs @@ -69,25 +69,20 @@ namespace BetterLyrics.WinUI3.Views public LyricsWindowViewModel ViewModel { get; private set; } = Ioc.Default.GetRequiredService(); - public void AutoSelectLyricsMode(LyricsWindowMode? type = null, bool? autoLook = null) + public void AutoSelectLyricsMode(LyricsWindowMode? type = null) { type ??= _settingsService.AppSettings.GeneralSettings.AutoStartWindowType; switch (type!) { case LyricsWindowMode.StandardMode: AppWindow.MoveAndResize(_settingsService.AppSettings.StandardModeSettings.WindowBounds.ToRectInt32()); + ViewModel.SetStandardModeTitleBarControlsStatus(); break; case LyricsWindowMode.DockMode: - DockFlyoutItem.IsChecked = true; - ViewModel.ToggleDockModeCommand.Execute(null); + ViewModel.ToggleDockMode(); break; case LyricsWindowMode.DesktopMode: - DesktopFlyoutItem.IsChecked = true; - ViewModel.ToggleDesktopModeCommand.Execute(null); - if (autoLook == null && _settingsService.AppSettings.DesktopModeSettings.AutoLockOnDesktopMode) - { - ViewModel.ToggleLockWindowCommand.Execute(null); - } + ViewModel.ToggleDesktopMode(); break; default: break; @@ -96,15 +91,11 @@ namespace BetterLyrics.WinUI3.Views private void AOTFlyoutItem_Click(object sender, RoutedEventArgs e) { - var overlappedPresenter = (OverlappedPresenter)AppWindow.Presenter; - overlappedPresenter.IsAlwaysOnTop = !overlappedPresenter.IsAlwaysOnTop; + ViewModel.ToggleAlwaysOnTop(); } private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args) { - if (args.DidPresenterChange) - UpdateTitleBarWindowButtonsVisibility(); - if (args.DidPositionChange || args.DidSizeChange) { var size = AppWindow.Size; @@ -120,10 +111,7 @@ namespace BetterLyrics.WinUI3.Views { _settingsService.AppSettings.DesktopModeSettings.WindowBounds = new Windows.Foundation.Rect(rect.X, rect.Y, size.Width, size.Height); } - else if (ViewModel.LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.DockMode) - { - - } + else if (ViewModel.LiveStates.CurrentLyricsWindowMode == LyricsWindowMode.DockMode) { } else { _settingsService.AppSettings.StandardModeSettings.WindowBounds = new Windows.Foundation.Rect(rect.X, rect.Y, size.Width, size.Height); @@ -134,34 +122,13 @@ namespace BetterLyrics.WinUI3.Views private void FullScreenFlyoutItem_Click(object sender, RoutedEventArgs e) { - switch (AppWindow.Presenter.Kind) - { - case AppWindowPresenterKind.Default: - break; - case AppWindowPresenterKind.CompactOverlay: - break; - case AppWindowPresenterKind.FullScreen: - AppWindow.SetPresenter(AppWindowPresenterKind.Overlapped); - break; - case AppWindowPresenterKind.Overlapped: - AppWindow.SetPresenter(AppWindowPresenterKind.FullScreen); - break; - default: - break; - } + + ViewModel.ToggleFullscreen(); } - private void MiniFlyoutItem_Click(object sender, RoutedEventArgs e) + private void PIPFlyoutItem_Click(object sender, RoutedEventArgs e) { - ViewModel.TogglePictureInPictureModeCommand.Execute(null); - if (MiniFlyoutItem.IsChecked) - { - AppWindow.SetPresenter(AppWindowPresenterKind.CompactOverlay); - } - else - { - AppWindow.SetPresenter(AppWindowPresenterKind.Overlapped); - } + ViewModel.TogglePictureInPictureMode(); } private void SettingsMenuFlyoutItem_Click(object sender, RoutedEventArgs e) @@ -169,82 +136,6 @@ namespace BetterLyrics.WinUI3.Views WindowHelper.OpenWindow(); } - private void UpdateTitleBarWindowButtonsVisibility() - { - switch (AppWindow.Presenter.Kind) - { - case AppWindowPresenterKind.Default: - break; - case AppWindowPresenterKind.CompactOverlay: - AOTFlyoutItem.Visibility = DesktopFlyoutItem.Visibility = FullScreenFlyoutItem.Visibility = DockFlyoutItem.Visibility = - ClickThroughButton.Visibility = Visibility.Collapsed; - - ViewModel.IsImmersiveMode = true; - break; - case AppWindowPresenterKind.FullScreen: - - AOTFlyoutItem.Visibility = - ClickThroughButton.Visibility = - DesktopFlyoutItem.Visibility = - MiniFlyoutItem.Visibility = - DockFlyoutItem.Visibility = - Visibility.Collapsed; - FullScreenFlyoutItem.IsChecked = true; - ViewModel.IsImmersiveMode = true; - break; - case AppWindowPresenterKind.Overlapped: - DockFlyoutItem.Visibility = Visibility.Visible; - var overlappedPresenter = (OverlappedPresenter)AppWindow.Presenter; - if (DockFlyoutItem.IsChecked) - { - overlappedPresenter.IsMinimizable = - overlappedPresenter.IsMaximizable = false; - - AOTFlyoutItem.Visibility = - DesktopFlyoutItem.Visibility = - ClickThroughButton.Visibility = - FullScreenFlyoutItem.Visibility = - MiniFlyoutItem.Visibility = - Visibility.Collapsed; - - ViewModel.IsImmersiveMode = true; - } - else if (DesktopFlyoutItem.IsChecked) - { - overlappedPresenter.IsMinimizable = - overlappedPresenter.IsMaximizable = false; - - DockFlyoutItem.Visibility = - AOTFlyoutItem.Visibility = - FullScreenFlyoutItem.Visibility = - MiniFlyoutItem.Visibility = - Visibility.Collapsed; - - ClickThroughButton.Visibility = Visibility.Visible; - } - else - { - overlappedPresenter.IsMinimizable = - overlappedPresenter.IsMaximizable = true; - - AOTFlyoutItem.Visibility = - DesktopFlyoutItem.Visibility = - DockFlyoutItem.Visibility = - MiniFlyoutItem.Visibility = - FullScreenFlyoutItem.Visibility = - Visibility.Visible; - FullScreenFlyoutItem.IsChecked = false; - ClickThroughButton.Visibility = Visibility.Collapsed; - AOTFlyoutItem.IsChecked = overlappedPresenter.IsAlwaysOnTop; - - ViewModel.IsImmersiveMode = _settingsService.AppSettings.GeneralSettings.IsImmersiveMode; - } - break; - default: - break; - } - } - private void TopCommandGrid_PointerEntered(object sender, PointerRoutedEventArgs e) { if (ViewModel.IsImmersiveMode) @@ -279,18 +170,17 @@ namespace BetterLyrics.WinUI3.Views private void ClickThroughButton_Click(object sender, RoutedEventArgs e) { - ViewModel.ToggleLockWindowCommand.Execute(null); + ViewModel.ToggleLockWindow(); } private void DockFlyoutItem_Click(object sender, RoutedEventArgs e) { - ViewModel.ToggleDockModeCommand.Execute(null); + ViewModel.ToggleDockMode(); } private void DesktopFlyoutItem_Click(object sender, RoutedEventArgs e) { - ViewModel.ToggleDesktopModeCommand.Execute(null); - UpdateTitleBarWindowButtonsVisibility(); + ViewModel.ToggleDesktopMode(); } private void MusicGalleryMenuFlyoutItem_Click(object sender, RoutedEventArgs e)