fix(ui): 修复画布界面元素布局和间距问题

- 修复背景设置面板的位置偏移问题,调整Margin值从-115,-360,-55,50到-189,-360,-55,50
- 为各个工具面板添加设计时可见性属性(d:Visibility="Visible")以便预览
- 修复多个堆叠面板的Spacing属性,将负值改为正值以正确显示元素间距
- 在各个工具菜单区域添加中文注释标识(如<!--笔菜单-->, <!--橡皮菜单-->等)
- 调整了工具面板中的Spacing属性从-2到2,解决元素重叠问题
```
This commit is contained in:
PrefacedCorg
2026-05-01 23:03:20 +08:00
parent 3853fd31f4
commit 9fb18e020e
+14 -25
View File
@@ -1092,8 +1092,8 @@
<Border> <Border>
<Grid Width="0" Margin="0,0,0,5" RenderTransformOrigin="0,1"> <Grid Width="0" Margin="0,0,0,5" RenderTransformOrigin="0,1">
<Border ClipToBounds="True" x:Name="BackgroundPalette" <Border ClipToBounds="True" x:Name="BackgroundPalette"
Visibility="Collapsed" Visibility="Collapsed" d:Visibility="Visible"
Margin="-115,-360,-55,50" Margin="-189,-360,-55,50"
CornerRadius="8" CornerRadius="8"
Background="{DynamicResource SettingsPageBackground}" Opacity="1" BorderBrush="#2563eb" Background="{DynamicResource SettingsPageBackground}" Opacity="1" BorderBrush="#2563eb"
BorderThickness="1"> BorderThickness="1">
@@ -1234,18 +1234,11 @@
Label="{i18n:I18n Key=Board_Pen}" Label="{i18n:I18n Key=Board_Pen}"
IconGeometry="F1 M24,24z M0,0z M20.4786,1.42438C19.9985,1.23743 19.4847,1.15194 18.9698,1.17319 18.4549,1.19444 17.9499,1.32197 17.4869,1.54789 17.0368,1.76752 16.6358,2.07554 16.3083,2.45361L3.85516,14.9067 9.08243,20.134 21.5311,7.68529C21.9113,7.36382 22.223,6.96912 22.447,6.52438 22.6786,6.06462 22.8113,5.56167 22.8365,5.04763 22.8616,4.5336 22.7787,4.02012 22.593,3.54002 22.4073,3.05994 22.1232,2.62403 21.759,2.25988 21.3949,1.89574 20.9587,1.61132 20.4786,1.42438z M7.28056,21.1605L2.8286,16.7086 1.15912,22.83 7.28056,21.1605z" IconGeometry="F1 M24,24z M0,0z M20.4786,1.42438C19.9985,1.23743 19.4847,1.15194 18.9698,1.17319 18.4549,1.19444 17.9499,1.32197 17.4869,1.54789 17.0368,1.76752 16.6358,2.07554 16.3083,2.45361L3.85516,14.9067 9.08243,20.134 21.5311,7.68529C21.9113,7.36382 22.223,6.96912 22.447,6.52438 22.6786,6.06462 22.8113,5.56167 22.8365,5.04763 22.8616,4.5336 22.7787,4.02012 22.593,3.54002 22.4073,3.05994 22.1232,2.62403 21.759,2.25988 21.3949,1.89574 20.9587,1.61132 20.4786,1.42438z M7.28056,21.1605L2.8286,16.7086 1.15912,22.83 7.28056,21.1605z"
ButtonMouseUp="PenIcon_Click" /> ButtonMouseUp="PenIcon_Click" />
<!--笔菜单-->
<Border> <Border>
<Grid Margin="0,5,0,5" Width="0"> <Grid Margin="0,5,0,5" Width="0">
<Grid Name="BoardPenPaletteGrid" Margin="-160,-240,-53,50" RenderTransformOrigin="0,1"> <Grid Name="BoardPenPaletteGrid" Margin="-160,-240,-53,50" RenderTransformOrigin="0,1">
<Grid.RenderTransform> <Border x:Name="BoardPenPalette" Visibility="Collapsed" d:Visibility="Visible"
<TransformGroup>
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</Grid.RenderTransform>
<Border x:Name="BoardPenPalette" Visibility="Collapsed"
Background="{DynamicResource FloatBarBackground}" Background="{DynamicResource FloatBarBackground}"
Opacity="1" BorderBrush="#2563eb" Opacity="1" BorderBrush="#2563eb"
BorderThickness="1" CornerRadius="8"> BorderThickness="1" CornerRadius="8">
@@ -1560,17 +1553,10 @@
Label="{i18n:I18n Key=Board_Eraser}" Label="{i18n:I18n Key=Board_Eraser}"
IconGeometry="F1 M24,24z M0,0z M15.6314,20.7262L22.7921,13.5655C24.3494,12.141,24.2819,9.81776,22.8105,8.34633L16.7793,2.31508C15.3547,0.757753,13.0315,0.825236,11.5601,2.29666L4.38099,9.47574 15.6314,20.7262z M14.2172,22.1404L2.96677,10.89 1.20761,12.6491C-0.34971,14.0737,-0.281711,16.3974,1.18971,17.8688L6.15089,22.83 13.5276,22.83 14.2172,22.1404z" IconGeometry="F1 M24,24z M0,0z M15.6314,20.7262L22.7921,13.5655C24.3494,12.141,24.2819,9.81776,22.8105,8.34633L16.7793,2.31508C15.3547,0.757753,13.0315,0.825236,11.5601,2.29666L4.38099,9.47574 15.6314,20.7262z M14.2172,22.1404L2.96677,10.89 1.20761,12.6491C-0.34971,14.0737,-0.281711,16.3974,1.18971,17.8688L6.15089,22.83 13.5276,22.83 14.2172,22.1404z"
ButtonMouseUp="BoardEraserIcon_Click" /> ButtonMouseUp="BoardEraserIcon_Click" />
<!--橡皮菜单-->
<Border> <Border>
<Grid RenderTransformOrigin="0,1" Margin="-133,-172,13,55"> <Grid RenderTransformOrigin="0,1" Margin="-133,-172,13,55">
<Grid.RenderTransform> <Border Visibility="Collapsed" ClipToBounds="True" d:Visibility="Visible"
<TransformGroup>
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</Grid.RenderTransform>
<Border Visibility="Collapsed" ClipToBounds="True"
x:Name="BoardEraserSizePanel" x:Name="BoardEraserSizePanel"
CornerRadius="5" Background="{DynamicResource FloatBarBackground}" CornerRadius="5" Background="{DynamicResource FloatBarBackground}"
Opacity="1" Opacity="1"
@@ -1593,7 +1579,7 @@
</Canvas> </Canvas>
</Border> </Border>
<ikw:SimpleStackPanel Orientation="Horizontal" Margin="0,6,0,0" <ikw:SimpleStackPanel Orientation="Horizontal" Margin="0,6,0,0"
Spacing="-2" Spacing="2"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<Label Margin="0,0,0,0" Content="{i18n:I18n Key=Board_Size}" FontWeight="Bold" <Label Margin="0,0,0,0" Content="{i18n:I18n Key=Board_Size}" FontWeight="Bold"
@@ -1759,13 +1745,14 @@
Label="{i18n:I18n Key=Board_Shape}" Label="{i18n:I18n Key=Board_Shape}"
IconGeometry="F1 M24,24z M0,0z M17.8604,10.7597L12.0068,1.17001 6.13961,10.7597 17.8604,10.7597z M10.9345,13.2403L1.34476,13.2403 1.34476,22.83 10.9345,22.83 10.9345,13.2403z M17.8604,13.2403C15.2122,13.2403 13.0655,15.387 13.0655,18.0352 13.0655,20.6833 15.2122,22.83 17.8604,22.83 20.5085,22.83 22.6552,20.6833 22.6552,18.0352 22.6552,15.387 20.5085,13.2403 17.8604,13.2403z" IconGeometry="F1 M24,24z M0,0z M17.8604,10.7597L12.0068,1.17001 6.13961,10.7597 17.8604,10.7597z M10.9345,13.2403L1.34476,13.2403 1.34476,22.83 10.9345,22.83 10.9345,13.2403z M17.8604,13.2403C15.2122,13.2403 13.0655,15.387 13.0655,18.0352 13.0655,20.6833 15.2122,22.83 17.8604,22.83 20.5085,22.83 22.6552,20.6833 22.6552,18.0352 22.6552,15.387 20.5085,13.2403 17.8604,13.2403z"
ButtonMouseUp="ImageDrawShape_MouseUp" /> ButtonMouseUp="ImageDrawShape_MouseUp" />
<!--图形菜单-->
<Border Width="0"> <Border Width="0">
<Border x:Name="BoardBorderDrawShape" Visibility="Visible" <Border x:Name="BoardBorderDrawShape" Visibility="Visible"
Background="{DynamicResource FloatBarBackground}" Background="{DynamicResource FloatBarBackground}"
Opacity="1" BorderBrush="{DynamicResource FloatBarBorderBrush}" BorderThickness="1" CornerRadius="5" Opacity="1" BorderBrush="{DynamicResource FloatBarBorderBrush}" BorderThickness="1" CornerRadius="5"
Margin="-147,-286,-89,55"> Margin="-147,-286,-89,55">
<Viewbox> <Viewbox>
<ikw:SimpleStackPanel Spacing="-8" Orientation="Vertical"> <ikw:SimpleStackPanel Spacing="8" Orientation="Vertical">
<TextBlock FontSize="16" <TextBlock FontSize="16"
Foreground="{DynamicResource FloatBarForeground}" Foreground="{DynamicResource FloatBarForeground}"
HorizontalAlignment="Left" Margin="10,8"> HorizontalAlignment="Left" Margin="10,8">
@@ -1911,6 +1898,7 @@
Label="{i18n:I18n Key=Board_InsertImage}" Label="{i18n:I18n Key=Board_InsertImage}"
IconGeometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z" IconGeometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"
ButtonMouseUp="InsertImageOptions_MouseUp" /> ButtonMouseUp="InsertImageOptions_MouseUp" />
<!--插入图片菜单-->
<localControls:BoardMenuFrame x:Name="BoardImageOptionsPanel" Visibility="Visible" ClipToBounds="True" <localControls:BoardMenuFrame x:Name="BoardImageOptionsPanel" Visibility="Visible" ClipToBounds="True"
PlacementTarget="{Binding ElementName=BoardInsertImage}" PlacementTarget="{Binding ElementName=BoardInsertImage}"
PanelCornerRadius="5" HeaderCornerRadius="6,6,0,0" TitleFontSize="11" PanelCornerRadius="5" HeaderCornerRadius="6,6,0,0" TitleFontSize="11"
@@ -2002,6 +1990,7 @@
Label="{i18n:I18n Key=Board_Tools}" Label="{i18n:I18n Key=Board_Tools}"
IconGeometry="F1 M24,24z M0,0z M3.336,1.17001C2.13975,1.17001,1.17,2.13976,1.17,3.33601L1.17,8.75101C1.17,9.94726,2.13975,10.917,3.336,10.917L8.751,10.917C9.94725,10.917,10.917,9.94726,10.917,8.75101L10.917,3.33601C10.917,2.13976,9.94725,1.17001,8.751,1.17001L3.336,1.17001z M15.249,1.17001C14.0527,1.17001,13.083,2.13976,13.083,3.33601L13.083,8.75101C13.083,9.94726,14.0527,10.917,15.249,10.917L20.664,10.917C21.8602,10.917,22.83,9.94726,22.83,8.75101L22.83,3.33601C22.83,2.13976,21.8602,1.17001,20.664,1.17001L15.249,1.17001z M3.336,13.083C2.13975,13.083,1.17,14.0528,1.17,15.249L1.17,20.664C1.17,21.8603,2.13975,22.83,3.336,22.83L8.751,22.83C9.94725,22.83,10.917,21.8603,10.917,20.664L10.917,15.249C10.917,14.0528,9.94725,13.083,8.751,13.083L3.336,13.083z M15.249,13.083C14.0527,13.083,13.083,14.0528,13.083,15.249L13.083,20.664C13.083,21.8603,14.0527,22.83,15.249,22.83L20.664,22.83C21.8602,22.83,22.83,21.8603,22.83,20.664L22.83,15.249C22.83,14.0528,21.8602,13.083,20.664,13.083L15.249,13.083z" IconGeometry="F1 M24,24z M0,0z M3.336,1.17001C2.13975,1.17001,1.17,2.13976,1.17,3.33601L1.17,8.75101C1.17,9.94726,2.13975,10.917,3.336,10.917L8.751,10.917C9.94725,10.917,10.917,9.94726,10.917,8.75101L10.917,3.33601C10.917,2.13976,9.94725,1.17001,8.751,1.17001L3.336,1.17001z M15.249,1.17001C14.0527,1.17001,13.083,2.13976,13.083,3.33601L13.083,8.75101C13.083,9.94726,14.0527,10.917,15.249,10.917L20.664,10.917C21.8602,10.917,22.83,9.94726,22.83,8.75101L22.83,3.33601C22.83,2.13976,21.8602,1.17001,20.664,1.17001L15.249,1.17001z M3.336,13.083C2.13975,13.083,1.17,14.0528,1.17,15.249L1.17,20.664C1.17,21.8603,2.13975,22.83,3.336,22.83L8.751,22.83C9.94725,22.83,10.917,21.8603,10.917,20.664L10.917,15.249C10.917,14.0528,9.94725,13.083,8.751,13.083L3.336,13.083z M15.249,13.083C14.0527,13.083,13.083,14.0528,13.083,15.249L13.083,20.664C13.083,21.8603,14.0527,22.83,15.249,22.83L20.664,22.83C21.8602,22.83,22.83,21.8603,22.83,20.664L22.83,15.249C22.83,14.0528,21.8602,13.083,20.664,13.083L15.249,13.083z"
ButtonMouseUp="SymbolIconTools_MouseUp" /> ButtonMouseUp="SymbolIconTools_MouseUp" />
<!--工具菜单-->
<Border> <Border>
<Grid Width="0" Margin="0,0,0,5" RenderTransformOrigin="0,1"> <Grid Width="0" Margin="0,0,0,5" RenderTransformOrigin="0,1">
<Grid.RenderTransform> <Grid.RenderTransform>
@@ -2035,7 +2024,7 @@
MouseUp="CloseBordertools_MouseUp" /> MouseUp="CloseBordertools_MouseUp" />
</Grid> </Grid>
</Border> </Border>
<ikw:SimpleStackPanel Margin="10,3,10,2" Spacing="-2"> <ikw:SimpleStackPanel Margin="10,3,10,2" Spacing="2">
<ikw:SimpleStackPanel.Resources> <ikw:SimpleStackPanel.Resources>
<Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" /> <Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" />
</ikw:SimpleStackPanel.Resources> </ikw:SimpleStackPanel.Resources>
@@ -2935,7 +2924,7 @@
MouseUp="CloseBordertools_MouseUp" /> MouseUp="CloseBordertools_MouseUp" />
</Canvas> </Canvas>
</Border> </Border>
<ikw:SimpleStackPanel Orientation="Horizontal" Margin="0,8,0,0" Spacing="-2" <ikw:SimpleStackPanel Orientation="Horizontal" Margin="0,8,0,0" Spacing="2"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<Label Margin="0,0,0,0" Content="{i18n:I18n Key=Board_Size}" FontWeight="Bold" <Label Margin="0,0,0,0" Content="{i18n:I18n Key=Board_Size}" FontWeight="Bold"
@@ -3074,7 +3063,7 @@
</ikw:SimpleStackPanel> </ikw:SimpleStackPanel>
</Border> </Border>
<!----> <!---->
<ikw:SimpleStackPanel Margin="10,3,10,2" Spacing="-2"> <ikw:SimpleStackPanel Margin="10,3,10,2" Spacing="2">
<ikw:SimpleStackPanel.Resources> <ikw:SimpleStackPanel.Resources>
<Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" /> <Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" />
</ikw:SimpleStackPanel.Resources> </ikw:SimpleStackPanel.Resources>