From cb31aa0dbdbf98eb5aad309a4cb67d75d8b15217 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Fri, 12 Sep 2025 13:30:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(wpf):=20=E6=88=98=E6=96=97=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E5=87=BB=E4=BD=9C=E4=B8=9A=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=85=B3=E9=97=AD=E5=88=97=E8=A1=A8,=20=E5=8E=9F?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=BF=81=E7=A7=BB=E8=87=B3=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E5=8F=B3=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs | 11 +++++++++-- src/MaaWpfGui/Views/UI/CopilotView.xaml | 9 +++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index 4cfae6df6f..c3e4f7f573 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -556,9 +556,16 @@ namespace MaaWpfGui.ViewModels.UI // UI 绑定的方法 [UsedImplicitly] - public void SelectCopilotTask(int index) + public void SelectCopilotTask(object? sender, MouseButtonEventArgs? e = null) { - Filename = CopilotItemViewModels[index].FilePath; + if (e?.Source is FrameworkElement element && element.Tag is int index) + { + Filename = CopilotItemViewModels[index].FilePath; // 假设原方法接受int参数 + if (e.ChangedButton == MouseButton.Left) + { + UseCopilotList = false; + } + } } // UI 绑定的方法 diff --git a/src/MaaWpfGui/Views/UI/CopilotView.xaml b/src/MaaWpfGui/Views/UI/CopilotView.xaml index 65661beb2f..66314d2405 100644 --- a/src/MaaWpfGui/Views/UI/CopilotView.xaml +++ b/src/MaaWpfGui/Views/UI/CopilotView.xaml @@ -306,7 +306,7 @@ IsEnabled="{Binding ElementName=CopilotList, Path=DataContext.Idle}" IsHitTestVisible="{Binding ElementName=CopilotList, Path=DataContext.Idle}" ToolTip="{c:Binding CopilotId}"> - + + IsEnabled="{Binding ElementName=CopilotList, Path=DataContext.Idle}" + MouseRightButtonUp="{s:Action SelectCopilotTask}" + PreviewMouseLeftButtonUp="{s:Action SelectCopilotTask}" + Tag="{c:Binding Index}" />