refactor(工具栏): 将BorderTools从Border改为Popup控件并优化显示逻辑
重构工具栏中的BorderTools控件,将其从Border改为Popup控件,并添加自定义位置回调 优化显示/隐藏逻辑,使用IsOpen属性替代Visibility控制 更新相关动画效果调用为对应的Popup版本 调整UI样式和布局,提升视觉一致性
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Ink_Canvas
|
||||
else
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(EraserSizePanel);
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(PenPalette);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardPenPalette);
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace Ink_Canvas
|
||||
/// </summary>
|
||||
private void HideSubPanelsImmediately()
|
||||
{
|
||||
BorderTools.Visibility = Visibility.Collapsed;
|
||||
BorderTools.IsOpen = false;
|
||||
BoardBorderToolsPopup.IsOpen = false;
|
||||
PenPalette.Visibility = Visibility.Collapsed;
|
||||
BoardPenPalette.Visibility = Visibility.Collapsed;
|
||||
@@ -376,7 +376,7 @@ namespace Ink_Canvas
|
||||
/// </param>
|
||||
internal async void HideSubPanels(string mode = null, bool autoAlignCenter = false)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(PenPalette);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardPenPalette);
|
||||
@@ -1099,7 +1099,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
|
||||
|
||||
@@ -1151,7 +1151,7 @@ namespace Ink_Canvas
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void OperatingGuideWindowIcon_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
|
||||
|
||||
@@ -1171,7 +1171,7 @@ namespace Ink_Canvas
|
||||
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
|
||||
|
||||
@@ -1306,7 +1306,7 @@ namespace Ink_Canvas
|
||||
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
|
||||
|
||||
@@ -1385,7 +1385,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
//if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
|
||||
|
||||
@@ -1687,9 +1687,9 @@ namespace Ink_Canvas
|
||||
/// <param name="e">鼠标按钮事件参数</param>
|
||||
internal void SymbolIconTools_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (BorderTools.Visibility == Visibility.Visible || BoardBorderToolsPopup.IsOpen)
|
||||
if (BorderTools.IsOpen || BoardBorderToolsPopup.IsOpen)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
}
|
||||
else
|
||||
@@ -1697,8 +1697,7 @@ namespace Ink_Canvas
|
||||
HideSubPanels();
|
||||
if (currentMode == 0)
|
||||
{
|
||||
UpdateBorderToolsPosition();
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BorderTools);
|
||||
AnimationsHelper.ShowPopupWithSlideAndFade(BorderTools);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender || inkCanvas.Visibility != Visibility.Visible) return;
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
|
||||
GridNotifications.Visibility = Visibility.Collapsed;
|
||||
@@ -916,7 +916,7 @@ namespace Ink_Canvas
|
||||
private void SymbolIconOpenStrokes_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HidePopupWithSlideAndFade(BoardBorderToolsPopup);
|
||||
|
||||
var openFileDialog = new OpenFileDialog();
|
||||
|
||||
@@ -32,7 +32,11 @@ namespace Ink_Canvas
|
||||
internal void AttachSymbolIconRedo(ToolbarImageButton btn) => SymbolIconRedo = btn;
|
||||
internal void AttachCursorWithDelBtn(ToolbarImageButton btn) => CursorWithDelFloatingBarBtn = btn;
|
||||
internal void AttachWhiteboardBtn(ToolbarImageButton btn) => WhiteboardFloatingBarBtn = btn;
|
||||
internal void AttachToolsBtn(ToolbarImageButton btn) => ToolsFloatingBarBtn = btn;
|
||||
internal void AttachToolsBtn(ToolbarImageButton btn)
|
||||
{
|
||||
ToolsFloatingBarBtn = btn;
|
||||
BorderTools.PlacementTarget = btn;
|
||||
}
|
||||
internal void AttachFoldIcon(ToolbarImageButton btn) => Fold_Icon = btn;
|
||||
|
||||
internal void InitializeToolbarPlugins()
|
||||
|
||||
Reference in New Issue
Block a user