From c05b3770aca8c8858ce826c104343f890b3c29ce Mon Sep 17 00:00:00 2001 From: Aytackydln Date: Wed, 24 Jul 2024 22:06:24 +0200 Subject: [PATCH] add "Render paused" text --- Project-Aurora/Project-Aurora/ConfigUi.xaml | 11 +++++---- .../Project-Aurora/ConfigUi.xaml.cs | 24 ++++++++++++++++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Project-Aurora/Project-Aurora/ConfigUi.xaml b/Project-Aurora/Project-Aurora/ConfigUi.xaml index fa8164fa6..b832f450d 100755 --- a/Project-Aurora/Project-Aurora/ConfigUi.xaml +++ b/Project-Aurora/Project-Aurora/ConfigUi.xaml @@ -30,10 +30,8 @@ UseAeroCaptionButtons="True" /> - - - - + + @@ -76,7 +74,10 @@ diff --git a/Project-Aurora/Project-Aurora/ConfigUi.xaml.cs b/Project-Aurora/Project-Aurora/ConfigUi.xaml.cs index fba189d60..be2ee4c10 100755 --- a/Project-Aurora/Project-Aurora/ConfigUi.xaml.cs +++ b/Project-Aurora/Project-Aurora/ConfigUi.xaml.cs @@ -72,6 +72,7 @@ sealed partial class ConfigUi : INotifyPropertyChanged, IDisposable private readonly UpdateModule _updateModule; private static bool _changelogsShown; + private bool _renderPauseNoticeVisible = true; public Application? FocusedApplication { @@ -161,9 +162,26 @@ private async Task KeyboardTimerCallback() { if (DateTime.UtcNow - _lastActivated > _renderTimeout) { + if (!_renderPauseNoticeVisible) + { + Dispatcher.InvokeAsync(() => + { + _renderPauseNoticeVisible = true; + RenderPauseNotice.Visibility = Visibility.Visible; + }); + } return; } + if (_renderPauseNoticeVisible) + { + Dispatcher.InvokeAsync(() => + { + _renderPauseNoticeVisible = false; + RenderPauseNotice.Visibility = Visibility.Collapsed; + }); + } + _transitionAmount += _keyboardTimer.Elapsed.TotalSeconds; if (IsDragging) { @@ -463,7 +481,6 @@ private void ctrlProfileManager_PreviewMouseDown(object? sender, MouseButtonEven private void brdOverview_PreviewMouseDown(object? sender, MouseButtonEventArgs e) { _selectedManager = SelectedControl = FocusedApplication.Control; - } private void Window_SizeChanged(object? sender, SizeChangedEventArgs e) { @@ -528,4 +545,9 @@ public void Dispose() _runKeyboardUpdate = false; _virtualKeyboardTimer.Dispose(50); } + + private void RenderPauseNotice_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) + { + _lastActivated = DateTime.UtcNow; + } }