简化算子工具箱调用入口
This commit is contained in:
@@ -16,10 +16,11 @@
|
||||
<FontFamily x:Key="CsdFont">Microsoft YaHei UI</FontFamily>
|
||||
|
||||
<Style x:Key="OperatorToolboxTabItemStyle" TargetType="TabItem">
|
||||
<Setter Property="Padding" Value="10,5" />
|
||||
<Setter Property="Margin" Value="0,0,4,0" />
|
||||
<Setter Property="Padding" Value="6,3" />
|
||||
<Setter Property="Margin" Value="0,0,2,0" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource CsdFont}" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
<Setter Property="FontSize" Value="10.5" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
@@ -104,9 +105,11 @@
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding CategoryIcon}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding CategoryName}"
|
||||
Margin="5,0,0,0"
|
||||
Margin="3,0,0,0"
|
||||
FontSize="10.5"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:views="clr-namespace:XplorePlane.Views"
|
||||
Title="算子工具箱"
|
||||
Width="560" Height="560"
|
||||
Width="500" Height="560"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ShowInTaskbar="False"
|
||||
WindowStyle="None"
|
||||
|
||||
@@ -48,13 +48,6 @@
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OperatorPickerTabItemStyle" TargetType="TabItem">
|
||||
<Setter Property="Padding" Value="12,6" />
|
||||
<Setter Property="Margin" Value="0,0,4,0" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border
|
||||
@@ -350,189 +343,6 @@
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid
|
||||
x:Name="OperatorPickerOverlay"
|
||||
Grid.RowSpan="4"
|
||||
Background="#66000000"
|
||||
Panel.ZIndex="10"
|
||||
Visibility="Collapsed"
|
||||
MouseDown="OnOperatorPickerBackdropMouseDown">
|
||||
<Border
|
||||
Width="560"
|
||||
MaxHeight="560"
|
||||
Background="White"
|
||||
BorderBrush="#CFCFCF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8"
|
||||
MouseDown="OnOperatorPickerDialogMouseDown">
|
||||
<Grid x:Name="OperatorPickerPanel">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="14,10"
|
||||
Background="#F6F8FB"
|
||||
BorderBrush="#E5E5E5"
|
||||
BorderThickness="0,0,0,1">
|
||||
<DockPanel LastChildFill="False">
|
||||
<StackPanel DockPanel.Dock="Left">
|
||||
<TextBlock
|
||||
FontFamily="{StaticResource UiFont}"
|
||||
FontSize="14"
|
||||
FontWeight="SemiBold"
|
||||
Text="选择算子" />
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
FontFamily="{StaticResource UiFont}"
|
||||
FontSize="11"
|
||||
Foreground="#666666"
|
||||
Text="按类别切换 Tab,单击即可添加到当前流水线" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Width="28"
|
||||
Height="28"
|
||||
Margin="8,0,0,0"
|
||||
Click="OnCloseOperatorPickerClick"
|
||||
Content="×"
|
||||
Cursor="Hand"
|
||||
DockPanel.Dock="Right"
|
||||
FontSize="14" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Padding="14,10"
|
||||
BorderBrush="#E5E5E5"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBox
|
||||
x:Name="OperatorSearchBox"
|
||||
Padding="8,5"
|
||||
FontFamily="{StaticResource UiFont}"
|
||||
FontSize="11"
|
||||
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
|
||||
ToolTip="输入名称或分类过滤算子" />
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="2" Margin="14,10,14,14">
|
||||
<TabControl
|
||||
x:Name="OperatorCategoryTabs"
|
||||
ItemContainerStyle="{StaticResource OperatorPickerTabItemStyle}"
|
||||
ItemsSource="{Binding FilteredGroups}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding CategoryIcon}" />
|
||||
<TextBlock Margin="6,0,0,0" Text="{Binding CategoryName}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding Operators}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button
|
||||
Margin="0,0,0,8"
|
||||
Padding="10,8"
|
||||
Background="White"
|
||||
BorderBrush="#D8DDE6"
|
||||
BorderThickness="1"
|
||||
Click="OnOperatorPickerItemClick"
|
||||
Cursor="Hand"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Tag="{Binding Key}">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
x:Name="OperatorCard"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="6"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="OperatorCard" Property="Background" Value="#EDF5FF" />
|
||||
<Setter TargetName="OperatorCard" Property="BorderBrush" Value="#8EB8E8" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<DockPanel LastChildFill="True">
|
||||
<Border
|
||||
Width="32"
|
||||
Height="32"
|
||||
Margin="0,0,10,0"
|
||||
Background="#EEF4FF"
|
||||
CornerRadius="5"
|
||||
DockPanel.Dock="Left">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="15"
|
||||
Text="{Binding IconPath}" />
|
||||
</Border>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
FontFamily="{StaticResource UiFont}"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#1F1F1F"
|
||||
Text="{Binding DisplayName}" />
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
FontFamily="Consolas"
|
||||
FontSize="10"
|
||||
Foreground="#7A7A7A"
|
||||
Text="{Binding Key}" />
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</TabControl>
|
||||
|
||||
<Border
|
||||
Padding="18"
|
||||
Background="#FAFAFA"
|
||||
BorderBrush="#E6E6E6"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=OperatorCategoryTabs, Path=HasItems}" Value="False">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource UiFont}"
|
||||
FontSize="12"
|
||||
Foreground="#666666"
|
||||
Text="没有匹配的算子" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user