mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
feat(wpf): 战斗列表点击作业时自动关闭列表, 原逻辑迁移至鼠标右键
This commit is contained in:
@@ -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 绑定的方法
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
IsEnabled="{Binding ElementName=CopilotList, Path=DataContext.Idle}"
|
||||
IsHitTestVisible="{Binding ElementName=CopilotList, Path=DataContext.Idle}"
|
||||
ToolTip="{c:Binding CopilotId}">
|
||||
<TextBlock Text="{Binding Name}" ToolTip="{Binding CopilotId}"/>
|
||||
<TextBlock Text="{Binding Name}" ToolTip="{Binding CopilotId}" />
|
||||
</CheckBox>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
@@ -325,10 +325,11 @@
|
||||
hc:VisualElement.HighlightForeground="{DynamicResource PrimaryBrush}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Command="{s:Action SelectCopilotTask}"
|
||||
CommandParameter="{c:Binding Index}"
|
||||
Foreground="{DynamicResource SecondaryTextBrush}"
|
||||
IsEnabled="{Binding ElementName=CopilotList, Path=DataContext.Idle}" />
|
||||
IsEnabled="{Binding ElementName=CopilotList, Path=DataContext.Idle}"
|
||||
MouseRightButtonUp="{s:Action SelectCopilotTask}"
|
||||
PreviewMouseLeftButtonUp="{s:Action SelectCopilotTask}"
|
||||
Tag="{c:Binding Index}" />
|
||||
<Button
|
||||
Grid.Column="3"
|
||||
Margin="0"
|
||||
|
||||
Reference in New Issue
Block a user