Merge branch 'net6' of https://github.com/InkCanvasForClass/community into net6
This commit is contained in:
@@ -442,53 +442,9 @@ namespace Ink_Canvas
|
||||
/// </summary>
|
||||
private void UpdateRGBSliders(Color color)
|
||||
{
|
||||
if (BackgroundPalette != null && BackgroundPalette.Child is StackPanel stackPanel)
|
||||
{
|
||||
if (stackPanel.Children.Count > 1 && stackPanel.Children[1] is StackPanel contentPanel)
|
||||
{
|
||||
// 查找RGB滑块
|
||||
Slider rSlider = null;
|
||||
Slider gSlider = null;
|
||||
Slider bSlider = null;
|
||||
|
||||
// 遍历面板查找RGB滑块
|
||||
foreach (var child in contentPanel.Children)
|
||||
{
|
||||
if (child is StackPanel panel && panel.Orientation == Orientation.Horizontal)
|
||||
{
|
||||
foreach (var panelChild in panel.Children)
|
||||
{
|
||||
if (panelChild is Slider slider)
|
||||
{
|
||||
if (panel.Children.Count > 0 && panel.Children[0] is TextBlock label)
|
||||
{
|
||||
if (label.Text == "R:")
|
||||
{
|
||||
rSlider = slider;
|
||||
}
|
||||
else if (label.Text == "G:")
|
||||
{
|
||||
gSlider = slider;
|
||||
}
|
||||
else if (label.Text == "B:")
|
||||
{
|
||||
bSlider = slider;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新滑块值
|
||||
if (rSlider != null && gSlider != null && bSlider != null)
|
||||
{
|
||||
rSlider.Value = color.R;
|
||||
gSlider.Value = color.G;
|
||||
bSlider.Value = color.B;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (BackgroundRSlider != null) BackgroundRSlider.Value = color.R;
|
||||
if (BackgroundGSlider != null) BackgroundGSlider.Value = color.G;
|
||||
if (BackgroundBSlider != null) BackgroundBSlider.Value = color.B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,13 +563,6 @@ namespace Ink_Canvas
|
||||
PenPalette.Margin = new Thickness(currentMargin.Left, -200, currentMargin.Right, 32);
|
||||
UpdatePenPalettePosition();
|
||||
});
|
||||
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
BoardPenPaletteGrid.BeginAnimation(MarginProperty, null);
|
||||
var currentMargin = BoardPenPaletteGrid.Margin;
|
||||
BoardPenPaletteGrid.Margin = new Thickness(currentMargin.Left, -200, currentMargin.Right, 50);
|
||||
});
|
||||
}
|
||||
else if (penType == 1)
|
||||
{
|
||||
@@ -616,13 +609,6 @@ namespace Ink_Canvas
|
||||
PenPalette.Margin = new Thickness(currentMargin.Left, -157, currentMargin.Right, 32);
|
||||
UpdatePenPalettePosition();
|
||||
});
|
||||
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
BoardPenPaletteGrid.BeginAnimation(MarginProperty, null);
|
||||
var currentMargin = BoardPenPaletteGrid.Margin;
|
||||
BoardPenPaletteGrid.Margin = new Thickness(currentMargin.Left, -154, currentMargin.Right, 50);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace Ink_Canvas
|
||||
BorderDrawShape.Visibility = Visibility.Collapsed;
|
||||
BoardBorderDrawShape.Visibility = Visibility.Collapsed;
|
||||
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, "BackgroundPalette") is Border bgPalette)
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, "BackgroundPalette") is UIElement bgPalette)
|
||||
{
|
||||
bgPalette.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ namespace Ink_Canvas
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardTwoFingerGestureBorder);
|
||||
|
||||
// 隐藏背景设置面板
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, "BackgroundPalette") is Border bgPalette)
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, "BackgroundPalette") is UIElement bgPalette)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(bgPalette);
|
||||
}
|
||||
@@ -1687,7 +1687,7 @@ namespace Ink_Canvas
|
||||
/// <param name="e">鼠标按钮事件参数</param>
|
||||
private void SymbolIconTools_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (BorderTools.Visibility == Visibility.Visible)
|
||||
if (BorderTools.Visibility == Visibility.Visible || BoardBorderTools.Visibility == Visibility.Visible)
|
||||
{
|
||||
AnimationsHelper.HideWithSlideAndFade(BorderTools);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
|
||||
@@ -1695,9 +1695,15 @@ namespace Ink_Canvas
|
||||
else
|
||||
{
|
||||
HideSubPanels();
|
||||
UpdateBorderToolsPosition();
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BorderTools);
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardBorderTools);
|
||||
if (currentMode == 0)
|
||||
{
|
||||
UpdateBorderToolsPosition();
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BorderTools);
|
||||
}
|
||||
else
|
||||
{
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardBorderTools);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user