From 61f962d2276c85a269c7bb918443583dca0c6386 Mon Sep 17 00:00:00 2001 From: Royce551 Date: Sun, 19 Sep 2021 09:22:15 -0500 Subject: [PATCH] focus mode --- .../FRESHMusicPlayer-WPF/MainWindow.xaml.cs | 42 ++++++------- .../Pages/FullscreenPage.xaml | 20 +++--- .../Pages/FullscreenPage.xaml.cs | 61 ++++++++++++++++++- 3 files changed, 87 insertions(+), 36 deletions(-) diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-WPF/MainWindow.xaml.cs b/FRESHMusicPlayer/FRESHMusicPlayer-WPF/MainWindow.xaml.cs index 8893f83..09d5bf9 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-WPF/MainWindow.xaml.cs +++ b/FRESHMusicPlayer/FRESHMusicPlayer-WPF/MainWindow.xaml.cs @@ -59,7 +59,7 @@ namespace FRESHMusicPlayer public GUILibrary Library; public IMetadataProvider CurrentTrack; - public const string WindowName = "FRESHMusicPlayer [Blueprint 11 b.8.29.2021; Not stable!]"; + public const string WindowName = "FRESHMusicPlayer [Blueprint 11 b.9.18.2021; Not stable!]"; public PlaytimeTrackingHandler TrackingHandler; public bool PauseAfterCurrentTrack = false; @@ -287,28 +287,28 @@ namespace FRESHMusicPlayer SelectedAuxiliaryPane = AuxiliaryPane.None; } public bool IsControlsBoxVisible { get; private set; } = false; - public void ShowControlsBox() + public async void ShowControlsBox() { + + var navBarStoryboard = InterfaceUtils.GetThicknessAnimation( + new Thickness(0, -25, 0, 0), + new Thickness(0), + TimeSpan.FromMilliseconds(500), + new PropertyPath(MarginProperty), + new ExponentialEase { EasingMode = EasingMode.EaseIn, Exponent = 3 }); + var controlsBoxStoryboard = InterfaceUtils.GetThicknessAnimation( + new Thickness(0, 0, 0, -84), + new Thickness(0), + TimeSpan.FromMilliseconds(500), + new PropertyPath(MarginProperty), + new ExponentialEase { EasingMode = EasingMode.EaseIn, Exponent = 3 }); + navBarStoryboard.Begin(MainBar); + await controlsBoxStoryboard.BeginStoryboardAsync(ControlsBoxBorder); IsControlsBoxVisible = true; - var navBarStoryboard = InterfaceUtils.GetThicknessAnimation( - new Thickness(0, -25, 0, 0), - new Thickness(0), - TimeSpan.FromMilliseconds(500), - new PropertyPath(MarginProperty), - new ExponentialEase { EasingMode = EasingMode.EaseIn, Exponent = 3 }); - var controlsBoxStoryboard = InterfaceUtils.GetThicknessAnimation( - new Thickness(0, 0, 0, -84), - new Thickness(0), - TimeSpan.FromMilliseconds(500), - new PropertyPath(MarginProperty), - new ExponentialEase { EasingMode = EasingMode.EaseIn, Exponent = 3 }); - navBarStoryboard.Begin(MainBar); - controlsBoxStoryboard.Begin(ControlsBoxBorder); - } - public void HideControlsBox() + public async void HideControlsBox() { - IsControlsBoxVisible = false; + var navBarStoryboard = InterfaceUtils.GetThicknessAnimation( new Thickness(0), new Thickness(0, -25, 0, 0), @@ -322,8 +322,8 @@ namespace FRESHMusicPlayer new PropertyPath(MarginProperty), new ExponentialEase { EasingMode = EasingMode.EaseIn, Exponent = 3 }); navBarStoryboard.Begin(MainBar); - controlsBoxStoryboard.Begin(ControlsBoxBorder); - + await controlsBoxStoryboard.BeginStoryboardAsync(ControlsBoxBorder); + IsControlsBoxVisible = false; } public void ProcessSettings(bool initialize = false) diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-WPF/Pages/FullscreenPage.xaml b/FRESHMusicPlayer/FRESHMusicPlayer-WPF/Pages/FullscreenPage.xaml index b0b1550..1d1e708 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-WPF/Pages/FullscreenPage.xaml +++ b/FRESHMusicPlayer/FRESHMusicPlayer-WPF/Pages/FullscreenPage.xaml @@ -7,25 +7,21 @@ xmlns:local="clr-namespace:FRESHMusicPlayer.Pages" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" - Title="FullscreenPage" Unloaded="Page_Unloaded"> + Title="FullscreenPage" Unloaded="Page_Unloaded" MouseMove="Page_MouseMove"> - - - - - - - - - - - + +