Skip to content

Commit

Permalink
add "Render paused" text
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Jul 24, 2024
1 parent a6965f3 commit c05b377
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Project-Aurora/Project-Aurora/ConfigUi.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
UseAeroCaptionButtons="True" />
</WindowChrome.WindowChrome>
<DockPanel x:Name="bg_grid" Background="#AA660000" IsHitTestVisible="True">
<Grid Width="Auto" Height="25" Background="#10000000" DockPanel.Dock="Top"></Grid>
<Grid Name="ProfileStackGrid" HorizontalAlignment="Left" Width="56" Background="#3F000000" DockPanel.Dock="Left">

</Grid>
<Grid Width="Auto" Height="25" Background="#10000000" DockPanel.Dock="Top" />
<Grid Name="ProfileStackGrid" HorizontalAlignment="Left" Width="56" Background="#3F000000" DockPanel.Dock="Left" />

<Grid x:Name="gridManagers" Margin="5,5,0,5" HorizontalAlignment="Left" Width="200" DockPanel.Dock="Left">
<StackPanel x:Name="stackPanelManagers">
Expand Down Expand Up @@ -76,7 +74,10 @@
</Grid.CacheMode>
</Grid>
<Label x:Name="KeyboardRecordMessage" Content="Please select key(s) you want to assign"
HorizontalAlignment="Right" Foreground="Red" Height="26" VerticalAlignment="Top" Margin="0,0,10,0" Grid.Column="1" Padding="0" IsHitTestVisible="False" />
HorizontalAlignment="Right" Foreground="Red" Height="26" VerticalAlignment="Top" Margin="0,0,10,0" Padding="0" IsHitTestVisible="False" />
<Border Name="RenderPauseNotice" Background="#66888888" PreviewMouseDown="RenderPauseNotice_OnPreviewMouseDown">
<Label Background="#AA000000" HorizontalContentAlignment="Center" VerticalAlignment="Center">Rendering paused</Label>
</Border>
</Grid>
</Border>
</Viewbox>
Expand Down
24 changes: 23 additions & 1 deletion Project-Aurora/Project-Aurora/ConfigUi.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -528,4 +545,9 @@ public void Dispose()
_runKeyboardUpdate = false;
_virtualKeyboardTimer.Dispose(50);
}

private void RenderPauseNotice_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
{
_lastActivated = DateTime.UtcNow;
}
}

0 comments on commit c05b377

Please sign in to comment.