add:浮动栏自定义

This commit is contained in:
2026-05-01 17:20:47 +08:00
parent 5fc92cdd10
commit 6980abe331
27 changed files with 690 additions and 20 deletions
+7 -16
View File
@@ -2467,9 +2467,7 @@
</Border>
</Canvas>
<ikw:SimpleStackPanel Margin="2,0" Name="StackPanelFloatingBar" Orientation="Horizontal" Cursor="Arrow" HorizontalAlignment="Left">
<!--<ikw:SimpleStackPanel Name="Cursor_Icon" MouseDown="Border_MouseDown" MouseUp="CursorIcon_Click"-->
<controls:ToolbarImageButton x:Name="Cursor_Icon" ButtonMouseUp="CursorIcon_Click" Label="{i18n:I18n Key=FloatingBar_Mouse}" />
<controls:ToolbarImageButton x:Name="Pen_Icon" ButtonMouseUp="PenIcon_Click" Label="{i18n:I18n Key=FloatingBar_Annotate}" />
<!-- Cursor_Icon / Pen_Icon 由 ToolbarRegistry 动态注入(见 Controls/Toolbar/Items/* -->
<ikw:SimpleStackPanel Width="0"
Orientation="{Binding ElementName=StackPanelFloatingBar, Path=Orientation}">
<Grid Margin="-14,5,14,5" Width="0" RenderTransformOrigin=" 1,0">
@@ -2849,15 +2847,12 @@
ButtonMouseDown="FloatingBarToolBtnMouseDownFeedback_Panel" ButtonMouseLeave="FloatingBarToolBtnMouseLeaveFeedback_Panel" ButtonMouseUp="QuickColorGreen_Click" ToolTip="{i18n:I18n Key=Canvas_Color_Green}"/>
</ikw:SimpleStackPanel>
<controls:ToolbarImageButton x:Name="SymbolIconDelete" ButtonMouseUp="SymbolIconDelete_MouseUp" IconBrush="{DynamicResource RedBrush}" Label="{i18n:I18n Key=FloatingBar_Clear}" />
<!-- SymbolIconDelete 由 ClearToolItem 动态注入(BeforeAnchor=StackPanelCanvasControls -->
<ikw:SimpleStackPanel Name="StackPanelCanvasControls" Visibility="Visible"
Orientation="{Binding ElementName=StackPanelFloatingBar, Path=Orientation}">
<controls:ToolbarImageButton x:Name="Eraser_Icon" ButtonMouseUp="EraserIcon_Click" Label="{i18n:I18n Key=FloatingBar_AreaEraser}" />
<controls:ToolbarImageButton x:Name="EraserByStrokes_Icon" ButtonMouseUp="EraserIconByStrokes_Click" Label="{i18n:I18n Key=FloatingBar_StrokeEraser}" />
<controls:ToolbarImageButton x:Name="SymbolIconSelect" ButtonMouseUp="SymbolIconSelect_MouseUp" Label="{i18n:I18n Key=FloatingBar_LassoSelect}" />
<controls:ToolbarImageButton x:Name="ShapeDrawFloatingBarBtn" ButtonMouseUp="ImageDrawShape_MouseUp" Label="{i18n:I18n Key=FloatingBar_Geometry}" />
<!-- Eraser_Icon / EraserByStrokes_Icon / SymbolIconSelect / ShapeDrawFloatingBarBtn 由 ToolbarRegistry 注入(Prepend -->
<Grid Width="0">
<Border x:Name="BorderDrawShape" Background="{DynamicResource FloatBarBackground}" Opacity="1"
@@ -2911,9 +2906,7 @@
</ikw:SimpleStackPanel>
</Border>
</Grid>
<controls:ToolbarImageButton x:Name="SymbolIconUndo" ButtonMouseUp="SymbolIconUndo_MouseUp" Label="{i18n:I18n Key=Board_Undo}" IsEnabled="{Binding ElementName=BtnUndo, Path=IsEnabled}" />
<controls:ToolbarImageButton x:Name="SymbolIconRedo" ButtonMouseUp="SymbolIconRedo_MouseUp" Label="{i18n:I18n Key=Board_Redo}" IsEnabled="{Binding ElementName=BtnRedo, Path=IsEnabled}" />
<controls:ToolbarImageButton x:Name="CursorWithDelFloatingBarBtn" ButtonMouseUp="CursorWithDelIcon_Click" Label="{i18n:I18n Key=FloatingBar_ClearAndMouse}" />
<!-- SymbolIconUndo / SymbolIconRedo / CursorWithDelFloatingBarBtn 由 ToolbarRegistry 注入(Append -->
</ikw:SimpleStackPanel>
<Grid Width="0">
<Grid x:Name="BackgroundPaletteGrid" Margin="-203,-128,83,37">
@@ -3051,12 +3044,10 @@
</ikw:SimpleStackPanel>
</Border>
</Grid>
<ikw:SimpleStackPanel
<ikw:SimpleStackPanel x:Name="StackPanelFloatingBarEnd"
Orientation="{Binding ElementName=StackPanelFloatingBar, Path=Orientation}">
<Border Margin="2,0,2,0" BorderBrush="#71717a" BorderThickness="1,0,0,0" />
<controls:ToolbarImageButton x:Name="WhiteboardFloatingBarBtn" ButtonMouseUp="ImageBlackboard_MouseUp" Label="{i18n:I18n Key=FloatingBar_Whiteboard}" />
<controls:ToolbarImageButton x:Name="ToolsFloatingBarBtn" ButtonMouseUp="SymbolIconTools_MouseUp" Label="{i18n:I18n Key=Board_Tools}" />
<controls:ToolbarImageButton x:Name="Fold_Icon" ButtonMouseUp="FoldFloatingBar_MouseUp" Label="{i18n:I18n Key=FloatingBar_Hide}" />
<Border x:Name="FloatingBarEndSeparator" Margin="2,0,2,0" BorderBrush="#71717a" BorderThickness="1,0,0,0" />
<!-- WhiteboardFloatingBarBtn / ToolsFloatingBarBtn / Fold_Icon 由 ToolbarRegistry 注入(AfterAnchor=FloatingBarEndSeparator -->
<Grid Width="0">
<Border ClipToBounds="True" Name="BorderTools" Margin="-103,-156,-16,37"
CornerRadius="5" Background="{DynamicResource FloatBarBackground}" Opacity="1" BorderThickness="1"