mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-10 11:36:07 +08:00
feat: 增加一键恢复原速
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="20" VerticalAlignment="Center" MouseLeftButtonDown="DecreaseSpeed"/>
|
||||
<TextBlock x:Name="SpeedText" Text="1x" FontSize="22" VerticalAlignment="Center" Margin="4,0"/>
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="20" VerticalAlignment="Center" MouseLeftButtonDown="IncreaseSpeed"/>
|
||||
<TextBlock x:Name="RestoreSpeedIcon" Text="" FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="18" VerticalAlignment="Center" Margin="8,0,0,0" MouseLeftButtonDown="RestoreSpeed"/>
|
||||
<TextBlock x:Name="FullScreenIcon" Text="" FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="20" VerticalAlignment="Center" Margin="16,0,0,0" MouseLeftButtonDown="FullScreen"/>
|
||||
<TextBlock x:Name="RestoreWindowIcon" Text="" FontFamily="Segoe MDL2 Assets"
|
||||
|
||||
@@ -50,6 +50,14 @@ namespace CRSim.ScreenSimulator.Views
|
||||
{
|
||||
_timeService.Speed /= 2;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
if (_timeService.Speed == 1)
|
||||
{
|
||||
RestoreSpeedIcon.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
RestoreSpeedIcon.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void IncreaseSpeed(object sender, MouseButtonEventArgs e)
|
||||
@@ -58,9 +66,24 @@ namespace CRSim.ScreenSimulator.Views
|
||||
{
|
||||
_timeService.Speed *= 2;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
if (_timeService.Speed == 1)
|
||||
{
|
||||
RestoreSpeedIcon.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
RestoreSpeedIcon.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreSpeed(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
_timeService.Speed = 1;
|
||||
SpeedText.Text = "1x";
|
||||
RestoreSpeedIcon.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
_styleManager.DispatcherQueue.TryEnqueue(() =>
|
||||
|
||||
Reference in New Issue
Block a user