From b1ce0f4f6285e8d84c2f70d77449dd49de379394 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Wed, 13 May 2026 12:04:22 +0800 Subject: [PATCH] =?UTF-8?q?ai=E4=BC=98=E5=8C=9610?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyUserControl/CoverFlowControl.xaml.cs | 2 +- Wpf_AiSportsMicrospace/Views/Home.xaml.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs index 8461878..4083a24 100644 --- a/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs +++ b/Wpf_AiSportsMicrospace/MyUserControl/CoverFlowControl.xaml.cs @@ -23,7 +23,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl private const double CardWidth = 368; private const double CardHeight = 534; private const double CardGap = 30; // 卡片之间水平间距 - private const double SlideDurationMs = 260; // 动画时长 + private const double SlideDurationMs = 130; // 动画时长 private const double ProgressDurationMs = 2600; public int SelectedIndex diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs index 8bf0ded..0bb7c25 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs @@ -33,8 +33,9 @@ namespace Wpf_AiSportsMicrospace private Main _mainWin => Application.Current.MainWindow as Main; private WavingAction _lastGestureAction = WavingAction.None; private DateTime _lastMenuSlideTime = DateTime.MinValue; + private bool _menuWaveConsumed; private bool _isNavigating; - private const int MenuSlideCooldownMs = 300; + private const int MenuSlideCooldownMs = 150; public Home() { @@ -105,6 +106,7 @@ namespace Wpf_AiSportsMicrospace Utils.PreloadGifs(); IsGestureActive = true; _isNavigating = false; + _menuWaveConsumed = false; } private void Home_Unloaded(object sender, RoutedEventArgs e) { @@ -125,19 +127,27 @@ namespace Wpf_AiSportsMicrospace switch (wavingaction) { case WavingAction.LeftWave: // 左手挥动 + if (_menuWaveConsumed) + return; + if ((now - _lastMenuSlideTime).TotalMilliseconds < MenuSlideCooldownMs) return; _lastMenuSlideTime = now; + _menuWaveConsumed = true; _lastGestureAction = wavingaction; Dispatcher.BeginInvoke(() => coverFlow.SlideRight(), DispatcherPriority.Input); break; case WavingAction.RightWave: // 右手挥动 + if (_menuWaveConsumed) + return; + if ((now - _lastMenuSlideTime).TotalMilliseconds < MenuSlideCooldownMs) return; _lastMenuSlideTime = now; + _menuWaveConsumed = true; _lastGestureAction = wavingaction; Dispatcher.BeginInvoke(() => coverFlow.SlideLeft(), DispatcherPriority.Input); break; @@ -165,6 +175,7 @@ namespace Wpf_AiSportsMicrospace if (_lastGestureAction == WavingAction.None) return; + _menuWaveConsumed = false; _lastGestureAction = WavingAction.None; Dispatcher.BeginInvoke(() => coverFlow.CancelSelectedProgress(), DispatcherPriority.Background); break;