fix: 修复配方编辑输入框裁切及模型字段绑定
This commit is contained in:
parent
cbf97b6b4f
commit
a4348eb472
@ -82,7 +82,7 @@
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border Background="{StaticResource Panel}" BorderBrush="{StaticResource Line}"
|
||||
BorderThickness="1" CornerRadius="4">
|
||||
BorderThickness="1" CornerRadius="4" Padding="0">
|
||||
<Path HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0"
|
||||
Fill="{StaticResource FgDim}" Data="M 0 0 L 8 0 L 4 5 Z" />
|
||||
</Border>
|
||||
@ -135,12 +135,14 @@
|
||||
<!-- TextBox:同 ComboBox,WPF 默认模板是白底。配方编辑器满屏都是输入框,
|
||||
不重写就是深底白框一片花。 -->
|
||||
<Style TargetType="TextBox">
|
||||
<!-- 模板内部 Border 必须显式绑定 Padding,避免继承全局面板的 10px 内边距。 -->
|
||||
<Setter Property="Foreground" Value="{StaticResource Fg}" />
|
||||
<Setter Property="CaretBrush" Value="{StaticResource Accent}" />
|
||||
<Setter Property="Background" Value="{StaticResource Panel}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Line}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Height" Value="26" />
|
||||
<Setter Property="MinHeight" Value="28" />
|
||||
<Setter Property="Padding" Value="6,3" />
|
||||
<Setter Property="FontFamily" Value="Microsoft YaHei" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
@ -151,8 +153,8 @@
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Margin="6,0" VerticalAlignment="Center" />
|
||||
CornerRadius="4" Padding="{TemplateBinding Padding}">
|
||||
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||
@ -179,7 +181,7 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border x:Name="box" Width="16" Height="16" CornerRadius="3"
|
||||
Background="{StaticResource Panel}"
|
||||
BorderBrush="{StaticResource Line}" BorderThickness="1"
|
||||
BorderBrush="{StaticResource Line}" BorderThickness="1" Padding="0"
|
||||
VerticalAlignment="Center">
|
||||
<Path x:Name="tick" Width="10" Height="10" Stretch="Fill"
|
||||
Fill="{StaticResource Accent}" Visibility="Collapsed"
|
||||
|
||||
@ -217,7 +217,21 @@
|
||||
<TextBlock Text="判定条件" Style="{StaticResource Title}" FontSize="13" Margin="0,10,0,6" />
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Text="本步无判定条件(只能靠超时推进)" />
|
||||
<TextBlock Text="本步无判定条件(只能靠超时推进)">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Detection}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Detection.Method}" Value="">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<Grid Style="{StaticResource Row}" Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -464,11 +478,11 @@
|
||||
|
||||
<!-- ==================== 检测模型 ==================== -->
|
||||
<TabItem Header="检测模型">
|
||||
<StackPanel Margin="10" DataContext="{Binding Recipe}">
|
||||
<StackPanel x:Name="ModelSettings" Margin="10" DataContext="{Binding Recipe}">
|
||||
<CheckBox Content="使用检测模型(object_* 与 hand_near_object / person_present 依赖它)"
|
||||
IsChecked="{Binding HasModel}" Margin="0,0,0,10" />
|
||||
|
||||
<StackPanel Visibility="{Binding HasModel, Converter={StaticResource BoolToVis}}" DataContext="{Binding Model}">
|
||||
<StackPanel Visibility="{Binding DataContext.HasModel, ElementName=ModelSettings, Converter={StaticResource BoolToVis}}" DataContext="{Binding Model}">
|
||||
<Grid Style="{StaticResource Row}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@ -489,11 +503,13 @@
|
||||
<TextBox Grid.Column="1" Text="{Binding InputSize}" HorizontalAlignment="Left" Width="120" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock Style="{StaticResource Title}" FontSize="13" Margin="0,10,0,6" Text="{Binding Title}" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
|
||||
<Button Content="加类别" Style="{StaticResource Mini}" Command="{Binding AddCommand}" />
|
||||
<StackPanel DataContext="{Binding Classes}">
|
||||
<TextBlock Style="{StaticResource Title}" FontSize="13" Margin="0,10,0,6" Text="{Binding Title}" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
|
||||
<Button Content="加类别" Style="{StaticResource Mini}" Command="{Binding AddCommand}" />
|
||||
</StackPanel>
|
||||
<ItemsControl ItemsSource="{Binding Items}" />
|
||||
</StackPanel>
|
||||
<ItemsControl ItemsSource="{Binding Items}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Margin="0,10,0,0" Foreground="{StaticResource FgDim}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user