#0029 调整页面预览

This commit is contained in:
zhengxuan.zhang
2026-03-15 20:26:58 +08:00
parent e79fc288c0
commit 06cc42ff33
4 changed files with 99 additions and 53 deletions
@@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
d:DesignHeight="700" d:DesignHeight="700"
d:DesignWidth="400" d:DesignWidth="350"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
@@ -119,15 +119,17 @@
Style="{StaticResource ToolbarBtn}" Style="{StaticResource ToolbarBtn}"
ToolTip="保存流水线" /> ToolTip="保存流水线" />
<Button <Button
Width="43"
Command="{Binding SaveAsPipelineCommand}" Command="{Binding SaveAsPipelineCommand}"
Content="另存为" Content="另存为"
Style="{StaticResource ToolbarBtn}" Style="{StaticResource ToolbarBtn}"
ToolTip="另存为" Width="43" /> ToolTip="另存为" />
<Button <Button
Width="43"
Command="{Binding LoadPipelineCommand}" Command="{Binding LoadPipelineCommand}"
Content="加载" Content="加载"
Style="{StaticResource ToolbarBtn}" Style="{StaticResource ToolbarBtn}"
ToolTip="加载流水线" Width="43" /> ToolTip="加载流水线" />
<Button <Button
Command="{Binding ExecutePipelineCommand}" Command="{Binding ExecutePipelineCommand}"
Content="▶" Content="▶"
@@ -157,8 +159,8 @@
BorderThickness="0" BorderThickness="0"
ItemContainerStyle="{StaticResource PipelineNodeItemStyle}" ItemContainerStyle="{StaticResource PipelineNodeItemStyle}"
ItemsSource="{Binding PipelineNodes}" ItemsSource="{Binding PipelineNodes}"
SelectedItem="{Binding SelectedNode, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> SelectedItem="{Binding SelectedNode, Mode=TwoWay}">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid x:Name="NodeRoot" MinHeight="48"> <Grid x:Name="NodeRoot" MinHeight="48">
@@ -169,57 +171,100 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 连接线列:上半段 + 下半段 --> <!-- 连接线列:上半段 + 下半段 -->
<Line x:Name="TopLine" <Line
Stroke="#5B9BD5" StrokeThickness="2" x:Name="TopLine"
X1="0" X2="0" Y1="0" Y2="10" HorizontalAlignment="Center"
VerticalAlignment="Top" VerticalAlignment="Top"
HorizontalAlignment="Center" /> Stroke="#5B9BD5"
<Line Stroke="#5B9BD5" StrokeThickness="2" StrokeThickness="2"
X1="0" X2="0" Y1="0" Y2="14" X1="0"
X2="0"
Y1="0"
Y2="10" />
<Line
HorizontalAlignment="Center"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
HorizontalAlignment="Center" /> Stroke="#5B9BD5"
StrokeThickness="2"
X1="0"
X2="0"
Y1="0"
Y2="14" />
<!-- 算子图标 --> <!-- 算子图标 -->
<Border Grid.Column="0" <Border
Width="28" Height="28" Grid.Column="0"
Background="#E8F0FE" Width="28"
BorderBrush="#5B9BD5" BorderThickness="1.5" Height="28"
CornerRadius="4" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Center"> Background="#E8F0FE"
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="#5B9BD5"
FontSize="13" Text="⚙" /> BorderThickness="1.5"
CornerRadius="4">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="13"
Text="⚙" />
</Border> </Border>
<!-- 算子名称 --> <!-- 算子名称 -->
<TextBlock Grid.Column="1" <TextBlock
VerticalAlignment="Center" Grid.Column="1"
Margin="6,0,0,0" Margin="6,0,0,0"
FontFamily="Microsoft YaHei UI" FontSize="12" VerticalAlignment="Center"
FontFamily="Microsoft YaHei UI"
FontSize="12"
Text="{Binding DisplayName}" /> Text="{Binding DisplayName}" />
<!-- 操作按钮:上移 / 下移 / 删除(悬停显示) --> <!-- 操作按钮:上移 / 下移 / 删除(悬停显示) -->
<StackPanel x:Name="NodeActions" <StackPanel
x:Name="NodeActions"
Grid.Column="2" Grid.Column="2"
Orientation="Horizontal"
VerticalAlignment="Center"
Margin="0,0,4,0" Margin="0,0,4,0"
VerticalAlignment="Center"
Orientation="Horizontal"
Visibility="Collapsed"> Visibility="Collapsed">
<Button Content="▲" ToolTip="上移" Width="22" Height="22" <Button
Margin="1,0" FontSize="10" Cursor="Hand" Width="22"
Background="Transparent" BorderBrush="#cdcbcb" BorderThickness="1" Height="22"
Margin="1,0"
Background="Transparent"
BorderBrush="#cdcbcb"
BorderThickness="1"
Command="{Binding DataContext.MoveNodeUpCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" Command="{Binding DataContext.MoveNodeUpCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
CommandParameter="{Binding}" /> CommandParameter="{Binding}"
<Button Content="▼" ToolTip="下移" Width="22" Height="22" Content=""
Margin="1,0" FontSize="10" Cursor="Hand" Cursor="Hand"
Background="Transparent" BorderBrush="#cdcbcb" BorderThickness="1" FontSize="10"
ToolTip="上移" />
<Button
Width="22"
Height="22"
Margin="1,0"
Background="Transparent"
BorderBrush="#cdcbcb"
BorderThickness="1"
Command="{Binding DataContext.MoveNodeDownCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" Command="{Binding DataContext.MoveNodeDownCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
CommandParameter="{Binding}" /> CommandParameter="{Binding}"
<Button Content="✕" ToolTip="删除" Width="22" Height="22" Content=""
Margin="1,0" FontSize="10" Cursor="Hand" Cursor="Hand"
Background="Transparent" BorderBrush="#E05050" BorderThickness="1" FontSize="10"
ToolTip="下移" />
<Button
Width="22"
Height="22"
Margin="1,0"
Background="Transparent"
BorderBrush="#E05050"
BorderThickness="1"
Command="{Binding DataContext.RemoveOperatorCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" Command="{Binding DataContext.RemoveOperatorCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
CommandParameter="{Binding}" /> CommandParameter="{Binding}"
Content="✕"
Cursor="Hand"
FontSize="10"
ToolTip="删除" />
</StackPanel> </StackPanel>
</Grid> </Grid>
<DataTemplate.Triggers> <DataTemplate.Triggers>
+2 -1
View File
@@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:XplorePlane.Views"
d:DesignHeight="400" d:DesignHeight="400"
d:DesignWidth="250" d:DesignWidth="250"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -16,6 +17,6 @@
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center" <TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="图像" /> FontWeight="SemiBold" Foreground="#333333" Text="图像" />
</Border> </Border>
<Grid Grid.Row="1" /> <views:PipelineEditorView Grid.Row="1" />
</Grid> </Grid>
</UserControl> </UserControl>
+3 -3
View File
@@ -11,7 +11,7 @@
x:Name="ParentWindow" x:Name="ParentWindow"
Title="XplorePlane" Title="XplorePlane"
Width="1280" Width="1280"
Height="798" Height="1000"
d:DesignWidth="1280" d:DesignWidth="1280"
Background="#F5F5F5" Background="#F5F5F5"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
@@ -28,7 +28,7 @@
<Grid x:Name="LayoutRoot"> <Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="28*" /> <ColumnDefinition Width="28*" />
<ColumnDefinition Width="95*" />
<ColumnDefinition Width="1157*" /> <ColumnDefinition Width="1157*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
@@ -1737,7 +1737,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="180" /> <ColumnDefinition Width="180" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="200" /> <ColumnDefinition Width="350" />
<ColumnDefinition Width="350" /> <ColumnDefinition Width="350" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -23,7 +23,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
FontWeight="SemiBold" FontWeight="SemiBold"
Foreground="#333333" Foreground="#333333"
Text="2D" /> Text="实时图像" />
</Border> </Border>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"