Revert "perf: 优化自动战斗 tab 样式,避免切页重置状态"

This reverts commit 310c1d1b28.
This commit is contained in:
uye
2026-03-28 13:21:06 +08:00
parent 6b63c791c6
commit adc5e1941f
4 changed files with 36 additions and 115 deletions

View File

@@ -7,7 +7,6 @@
<ResourceDictionary Source="Styles/MessageBox.xaml" />
<ResourceDictionary Source="Styles/TextBlock.xaml" />
<ResourceDictionary Source="Styles/Button.xaml" />
<ResourceDictionary Source="Styles/RadioButton.xaml" />
<ResourceDictionary Source="Styles/CheckBox.xaml" />
<ResourceDictionary Source="Styles/ComboBox.xaml" />
<ResourceDictionary Source="Styles/NumericUpDown.xaml" />

View File

@@ -1,38 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="https://handyorg.github.io/handycontrol">
<Style x:Key="SegmentedSelectorBorderStyle" TargetType="{x:Type Border}">
<Setter Property="Padding" Value="2" />
<Setter Property="Background" Value="{DynamicResource MouseOverRegionBrushOpacity75}" />
<Setter Property="CornerRadius" Value="4" />
</Style>
<Style x:Key="SegmentedSelectorPanelStyle" TargetType="{x:Type WrapPanel}">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style
x:Key="SegmentedSelectorRadioButtonStyle"
BasedOn="{StaticResource RadioGroupItemSingle}"
TargetType="{x:Type RadioButton}">
<Setter Property="hc:VisualElement.HighlightBackground" Value="{DynamicResource RegionBrush}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="Transparent" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="Transparent" />
</MultiTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@@ -44,6 +44,7 @@ using Stylet;
using static MaaWpfGui.Helper.CopilotHelper;
using static MaaWpfGui.Helper.PathsHelper;
using static MaaWpfGui.Models.AsstTasks.AsstCopilotTask;
using static Microsoft.WindowsAPICodePack.Shell.PropertySystem.SystemProperties.System;
using DataFormats = System.Windows.Forms.DataFormats;
using Task = System.Threading.Tasks.Task;
@@ -249,54 +250,6 @@ public partial class CopilotViewModel : Screen
}
}
[PropertyDependsOn(nameof(CopilotTabIndex))]
public bool IsMainCopilotTabSelected
{
get => CopilotTabIndex == 0;
set {
if (value)
{
CopilotTabIndex = 0;
}
}
}
[PropertyDependsOn(nameof(CopilotTabIndex))]
public bool IsSssCopilotTabSelected
{
get => CopilotTabIndex == 1;
set {
if (value)
{
CopilotTabIndex = 1;
}
}
}
[PropertyDependsOn(nameof(CopilotTabIndex))]
public bool IsParadoxCopilotTabSelected
{
get => CopilotTabIndex == 2;
set {
if (value)
{
CopilotTabIndex = 2;
}
}
}
[PropertyDependsOn(nameof(CopilotTabIndex))]
public bool IsActivityCopilotTabSelected
{
get => CopilotTabIndex == 3;
set {
if (value)
{
CopilotTabIndex = 3;
}
}
}
private string _displayFilename = string.Empty;
/// <summary>

View File

@@ -38,34 +38,41 @@
Grid.Row="0"
HorizontalAlignment="Center"
Orientation="Vertical">
<Border Style="{StaticResource SegmentedSelectorBorderStyle}">
<WrapPanel IsEnabled="{Binding Idle}" Style="{StaticResource SegmentedSelectorPanelStyle}">
<RadioButton
GroupName="CopilotTabs"
IsChecked="{Binding IsMainCopilotTabSelected}"
Style="{StaticResource SegmentedSelectorRadioButtonStyle}">
<TextBlock Text="{DynamicResource MainStageStoryCollectionSideStory}" />
</RadioButton>
<RadioButton
GroupName="CopilotTabs"
IsChecked="{Binding IsSssCopilotTabSelected}"
Style="{StaticResource SegmentedSelectorRadioButtonStyle}">
<TextBlock Text="{DynamicResource SSS}" />
</RadioButton>
<RadioButton
GroupName="CopilotTabs"
IsChecked="{Binding IsParadoxCopilotTabSelected}"
Style="{StaticResource SegmentedSelectorRadioButtonStyle}">
<TextBlock Text="{DynamicResource ParadoxSimulation}" />
</RadioButton>
<RadioButton
GroupName="CopilotTabs"
IsChecked="{Binding IsActivityCopilotTabSelected}"
Style="{StaticResource SegmentedSelectorRadioButtonStyle}">
<TextBlock Text="{DynamicResource OtherActivityStage}" />
</RadioButton>
</WrapPanel>
</Border>
<TabControl
HorizontalAlignment="Center"
BorderThickness="0"
IsEnabled="{Binding Idle}"
SelectedIndex="{Binding CopilotTabIndex}"
Style="{StaticResource TabControlSliding}">
<TabControl.Template>
<ControlTemplate TargetType="{x:Type TabControl}">
<Border
Padding="2"
Background="{DynamicResource MouseOverRegionBrushOpacity75}"
CornerRadius="4">
<ItemsPresenter />
</Border>
</ControlTemplate>
</TabControl.Template>
<TabControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</TabControl.ItemsPanel>
<TabControl.ItemContainerStyle>
<Style BasedOn="{StaticResource TabItemSliding}" TargetType="{x:Type TabItem}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="{DynamicResource MainStageStoryCollectionSideStory}" />
<TabItem Header="{DynamicResource SSS}" />
<TabItem Header="{DynamicResource ParadoxSimulation}" />
<TabItem Header="{DynamicResource OtherActivityStage}" />
</TabControl>
<Grid Margin="0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition />