[update] 工具栏V2基本完善,将Popup移动到了工具栏V2中,适配了基本的定位功能

This commit is contained in:
Dubi906w 2024-09-02 22:14:25 +08:00
parent 6a8220e7eb
commit 6b4d1be962
10 changed files with 687 additions and 198 deletions

View File

@ -118,18 +118,6 @@
<Grid x:Name="Main_Grid"> <Grid x:Name="Main_Grid">
<Popup Name="PenPaletteV2Popup" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Bottom">
<popups:ColorPalette x:Name="PenPaletteV2" Width="300" />
</Popup>
<Popup Name="SelectionPopupV2" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Bottom">
<popups:SelectionPopup x:Name="SelectionV2" Width="300" />
</Popup>
<Popup Name="ShapeDrawingPopupV2" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Bottom">
<popups:ShapeDrawingPopup x:Name="ShapeDrawingV2" Width="570" />
</Popup>
<!--// 黑/白 板幕布 //--> <!--// 黑/白 板幕布 //-->
<Image Name="FreezeFrameBackgroundImage" Visibility="Collapsed" /> <Image Name="FreezeFrameBackgroundImage" Visibility="Collapsed" />
<Grid Name="GridBackgroundCoverHolder"> <Grid Name="GridBackgroundCoverHolder">

View File

@ -214,6 +214,8 @@ namespace Ink_Canvas {
analyzer.Analyze(); analyzer.Analyze();
} }
public FloatingToolBarV2 FloatingToolBarV2;
private async void Window_Loaded(object sender, RoutedEventArgs e) { private async void Window_Loaded(object sender, RoutedEventArgs e) {
loadPenCanvas(); loadPenCanvas();
//加载设置 //加载设置
@ -229,6 +231,9 @@ namespace Ink_Canvas {
isLoaded = true; isLoaded = true;
FloatingToolBarV2 = new FloatingToolBarV2();
FloatingToolBarV2.Show();
BlackBoardLeftSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; BlackBoardLeftSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection;
BlackBoardRightSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; BlackBoardRightSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection;
@ -270,9 +275,6 @@ namespace Ink_Canvas {
new HWND(new WindowInteropHelper(this).Handle) new HWND(new WindowInteropHelper(this).Handle)
}); });
var ftv2 = new FloatingToolBarV2();
ftv2.Show();
UpdateIndexInfoDisplay(); UpdateIndexInfoDisplay();
} }

View File

@ -699,34 +699,29 @@ namespace Ink_Canvas {
#region PenPaletteV2 #region PenPaletteV2
private void PenPaletteV2Init() { private void PenPaletteV2Init() {
PenPaletteV2.ColorSelectionChanged += PenpaletteV2_ColorSelectionChanged; FloatingToolBarV2.PenPaletteV2_ColorSelectionChanged += PenpaletteV2_ColorSelectionChanged;
PenPaletteV2.ColorModeChanged += PenpaletteV2_ColorModeChanged; FloatingToolBarV2.PenPaletteV2_ColorModeChanged += PenpaletteV2_ColorModeChanged;
PenPaletteV2.CustomColorChanged += PenpaletteV2_CustomColorChanged; FloatingToolBarV2.PenPaletteV2_CustomColorChanged += PenpaletteV2_CustomColorChanged;
PenPaletteV2.PaletteShouldCloseEvent += PenpaletteV2_PaletteShouldCloseEvent; FloatingToolBarV2.PenPaletteV2_PenModeChanged += PenpaletteV2_PenModeChanged;
PenPaletteV2.PenModeChanged += PenpaletteV2_PenModeChanged; FloatingToolBarV2.PenPaletteV2.SelectedColor = ColorPalette.ColorPaletteColor.ColorRed;
PenPaletteV2.SelectedColor = ColorPalette.ColorPaletteColor.ColorRed;
} }
private void PenpaletteV2_ColorSelectionChanged(object sender, ColorPalette.ColorSelectionChangedEventArgs e) { private void PenpaletteV2_ColorSelectionChanged(object sender, ColorPalette.ColorSelectionChangedEventArgs e) {
if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return; if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return;
drawingAttributes.Color = PenPaletteV2.GetColor(e.NowColor, false, null); drawingAttributes.Color = FloatingToolBarV2.PenPaletteV2.GetColor(e.NowColor, false, null);
} }
private void PenpaletteV2_ColorModeChanged(object sender, ColorPalette.ColorModeChangedEventArgs e) { private void PenpaletteV2_ColorModeChanged(object sender, ColorPalette.ColorModeChangedEventArgs e) {
if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return; if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return;
drawingAttributes.Color = PenPaletteV2.GetColor(PenPaletteV2.SelectedColor, false, null); drawingAttributes.Color = FloatingToolBarV2.PenPaletteV2.GetColor(FloatingToolBarV2.PenPaletteV2.SelectedColor, false, null);
} }
private void PenpaletteV2_CustomColorChanged(object sender, ColorPalette.CustomColorChangedEventArgs e) { private void PenpaletteV2_CustomColorChanged(object sender, ColorPalette.CustomColorChangedEventArgs e) {
if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return; if (e.TriggerMode == ColorPalette.TriggerMode.TriggeredByCode) return;
if (PenPaletteV2.SelectedColor == ColorPalette.ColorPaletteColor.ColorCustom) if (FloatingToolBarV2.PenPaletteV2.SelectedColor == ColorPalette.ColorPaletteColor.ColorCustom)
drawingAttributes.Color = e.NowColor??new Color(); drawingAttributes.Color = e.NowColor??new Color();
} }
private void PenpaletteV2_PaletteShouldCloseEvent(object sender, RoutedEventArgs e) {
PenPaletteV2Popup.IsOpen = false;
}
private void PenpaletteV2_PenModeChanged(object sender, ColorPalette.PenModeChangedEventArgs e) { private void PenpaletteV2_PenModeChanged(object sender, ColorPalette.PenModeChangedEventArgs e) {
penType = e.NowMode == ColorPalette.PenMode.HighlighterMode ? 1 : 0; penType = e.NowMode == ColorPalette.PenMode.HighlighterMode ? 1 : 0;
drawingAttributes.Width = e.NowMode == ColorPalette.PenMode.HighlighterMode ? Settings.Canvas.HighlighterWidth / 2 : Settings.Canvas.InkWidth; drawingAttributes.Width = e.NowMode == ColorPalette.PenMode.HighlighterMode ? Settings.Canvas.HighlighterWidth / 2 : Settings.Canvas.InkWidth;

View File

@ -338,9 +338,7 @@ namespace Ink_Canvas {
} }
// new popup // new popup
PenPaletteV2Popup.IsOpen = false; FloatingToolBarV2.HideAllPopups();
SelectionPopupV2.IsOpen = false;
ShapeDrawingPopupV2.IsOpen = false;
await Task.Delay(20); await Task.Delay(20);
isHidingSubPanelsWhenInking = false; isHidingSubPanelsWhenInking = false;
@ -919,14 +917,6 @@ namespace Ink_Canvas {
// AnimationsHelper.ShowWithSlideFromBottomAndFade(PenPalette); // AnimationsHelper.ShowWithSlideFromBottomAndFade(PenPalette);
// AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardPenPalette); // AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardPenPalette);
//} //}
if (PenPaletteV2Popup.IsOpen == false) {
var transform = Pen_Icon.TransformToVisual(Main_Grid);
var pt = transform.Transform(new Point(0, 0));
PenPaletteV2Popup.VerticalOffset = pt.Y;
PenPaletteV2Popup.HorizontalOffset = pt.X - 32;
}
PenPaletteV2Popup.IsOpen = !PenPaletteV2Popup.IsOpen;
} }
else else
{ {
@ -954,16 +944,6 @@ namespace Ink_Canvas {
if (ShapeDrawingV2Layer.IsInShapeDrawingMode) ShapeDrawingV2Layer.EndShapeDrawing(); if (ShapeDrawingV2Layer.IsInShapeDrawingMode) ShapeDrawingV2Layer.EndShapeDrawing();
if (SelectedMode == ICCToolsEnum.LassoMode) {
if (SelectionPopupV2.IsOpen == false) {
var transform = SymbolIconSelect.TransformToVisual(Main_Grid);
var pt = transform.Transform(new Point(0, 0));
SelectionPopupV2.VerticalOffset = pt.Y;
SelectionPopupV2.HorizontalOffset = pt.X - 32;
}
SelectionPopupV2.IsOpen = !SelectionPopupV2.IsOpen;
} else HideSubPanels("select");
forceEraser = true; forceEraser = true;
drawingShapeMode = 0; drawingShapeMode = 0;
inkCanvas.IsManipulationEnabled = false; inkCanvas.IsManipulationEnabled = false;

View File

@ -1308,15 +1308,15 @@ namespace Ink_Canvas {
#region SelectionV2 Popup #region SelectionV2 Popup
private void SelectionV2Init() { private void SelectionV2Init() {
SelectionV2.SelectAllEvent += (sender, args) => { FloatingToolBarV2.SelectionV2_SelectAllEvent += (sender, args) => {
inkCanvas.Select(inkCanvas.Strokes); inkCanvas.Select(inkCanvas.Strokes);
SelectionPopupV2.IsOpen = false; FloatingToolBarV2.SelectionPopupV2.IsOpen = false;
}; };
SelectionV2.UnSelectEvent += (sender, args) => { FloatingToolBarV2.SelectionV2_UnSelectEvent += (sender, args) => {
CancelCurrentStrokesSelection(); CancelCurrentStrokesSelection();
SelectionPopupV2.IsOpen = false; FloatingToolBarV2.SelectionPopupV2.IsOpen = false;
}; };
SelectionV2.ReverseSelectEvent += (sender, args) => { FloatingToolBarV2.SelectionV2_ReverseSelectEvent += (sender, args) => {
var strokes = new StrokeCollection(inkCanvas.Strokes.Where(stroke => var strokes = new StrokeCollection(inkCanvas.Strokes.Where(stroke =>
!inkCanvas.GetSelectedStrokes().Contains(stroke)).Where(stroke=>!stroke.ContainsPropertyData(IsLockGuid))); !inkCanvas.GetSelectedStrokes().Contains(stroke)).Where(stroke=>!stroke.ContainsPropertyData(IsLockGuid)));
if (strokes.Any()) { if (strokes.Any()) {
@ -1324,39 +1324,36 @@ namespace Ink_Canvas {
} else { } else {
CancelCurrentStrokesSelection(); CancelCurrentStrokesSelection();
} }
SelectionPopupV2.IsOpen = false; FloatingToolBarV2.SelectionPopupV2.IsOpen = false;
}; };
SelectionV2.ApplyScaleToStylusTip = Settings.Canvas.ApplyScaleToStylusTip; FloatingToolBarV2.SelectionV2.ApplyScaleToStylusTip = Settings.Canvas.ApplyScaleToStylusTip;
SelectionV2.OnlyHitTestFullyContainedStrokes = Settings.Canvas.OnlyHitTestFullyContainedStrokes; FloatingToolBarV2.SelectionV2.OnlyHitTestFullyContainedStrokes = Settings.Canvas.OnlyHitTestFullyContainedStrokes;
SelectionV2.AllowClickToSelectLockedStroke = Settings.Canvas.AllowClickToSelectLockedStroke; FloatingToolBarV2.SelectionV2.AllowClickToSelectLockedStroke = Settings.Canvas.AllowClickToSelectLockedStroke;
SelectionV2.SelectionModeSelected = (SelectionPopup.SelectionMode)Settings.Canvas.SelectionMethod; FloatingToolBarV2.SelectionV2.SelectionModeSelected = (SelectionPopup.SelectionMode)Settings.Canvas.SelectionMethod;
SelectionV2.ApplyScaleToStylusTipChanged += (sender, args) => { FloatingToolBarV2.SelectionV2_ApplyScaleToStylusTipChanged += (sender, args) => {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.ApplyScaleToStylusTip = SelectionV2.ApplyScaleToStylusTip; Settings.Canvas.ApplyScaleToStylusTip = FloatingToolBarV2.SelectionV2.ApplyScaleToStylusTip;
ToggleSwitchApplyScaleToStylusTip.IsOn = SelectionV2.ApplyScaleToStylusTip; ToggleSwitchApplyScaleToStylusTip.IsOn = FloatingToolBarV2.SelectionV2.ApplyScaleToStylusTip;
SaveSettingsToFile(); SaveSettingsToFile();
}; };
SelectionV2.OnlyHitTestFullyContainedStrokesChanged += (sender, args) => { FloatingToolBarV2.SelectionV2_OnlyHitTestFullyContainedStrokesChanged += (sender, args) => {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.OnlyHitTestFullyContainedStrokes = SelectionV2.OnlyHitTestFullyContainedStrokes; Settings.Canvas.OnlyHitTestFullyContainedStrokes = FloatingToolBarV2.SelectionV2.OnlyHitTestFullyContainedStrokes;
ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn = SelectionV2.OnlyHitTestFullyContainedStrokes; ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn = FloatingToolBarV2.SelectionV2.OnlyHitTestFullyContainedStrokes;
SaveSettingsToFile(); SaveSettingsToFile();
}; };
SelectionV2.AllowClickToSelectLockedStrokeChanged += (sender, args) => { FloatingToolBarV2.SelectionV2_AllowClickToSelectLockedStrokeChanged += (sender, args) => {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.AllowClickToSelectLockedStroke = SelectionV2.AllowClickToSelectLockedStroke; Settings.Canvas.AllowClickToSelectLockedStroke = FloatingToolBarV2.SelectionV2.AllowClickToSelectLockedStroke;
ToggleSwitchAllowClickToSelectLockedStroke.IsOn = SelectionV2.AllowClickToSelectLockedStroke; ToggleSwitchAllowClickToSelectLockedStroke.IsOn = FloatingToolBarV2.SelectionV2.AllowClickToSelectLockedStroke;
SaveSettingsToFile(); SaveSettingsToFile();
}; };
SelectionV2.SelectionModeChanged += (sender, args) => { FloatingToolBarV2.SelectionV2_SelectionModeChanged += (sender, args) => {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.SelectionMethod = (int)args.NowMode; Settings.Canvas.SelectionMethod = (int)args.NowMode;
ComboBoxSelectionMethod.SelectedIndex = (int)args.NowMode; ComboBoxSelectionMethod.SelectedIndex = (int)args.NowMode;
SaveSettingsToFile(); SaveSettingsToFile();
}; };
SelectionV2.SelectionPopupShouldCloseEvent += (sender, args) => {
SelectionPopupV2.IsOpen = false;
};
} }
#endregion #endregion

View File

@ -1013,28 +1013,28 @@ namespace Ink_Canvas {
private void ToggleSwitchApplyScaleToStylusTip_OnToggled(object sender, RoutedEventArgs e) { private void ToggleSwitchApplyScaleToStylusTip_OnToggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.ApplyScaleToStylusTip = ToggleSwitchApplyScaleToStylusTip.IsOn; Settings.Canvas.ApplyScaleToStylusTip = ToggleSwitchApplyScaleToStylusTip.IsOn;
SelectionV2.ApplyScaleToStylusTip = ToggleSwitchApplyScaleToStylusTip.IsOn; FloatingToolBarV2.SelectionV2.ApplyScaleToStylusTip = ToggleSwitchApplyScaleToStylusTip.IsOn;
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchOnlyHitTestFullyContainedStrokes_OnToggled(object sender, RoutedEventArgs e) { private void ToggleSwitchOnlyHitTestFullyContainedStrokes_OnToggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.OnlyHitTestFullyContainedStrokes = ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn; Settings.Canvas.OnlyHitTestFullyContainedStrokes = ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn;
SelectionV2.OnlyHitTestFullyContainedStrokes = ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn; FloatingToolBarV2.SelectionV2.OnlyHitTestFullyContainedStrokes = ToggleSwitchOnlyHitTestFullyContainedStrokes.IsOn;
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ToggleSwitchAllowClickToSelectLockedStroke_OnToggled(object sender, RoutedEventArgs e) { private void ToggleSwitchAllowClickToSelectLockedStroke_OnToggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.AllowClickToSelectLockedStroke = ToggleSwitchAllowClickToSelectLockedStroke.IsOn; Settings.Canvas.AllowClickToSelectLockedStroke = ToggleSwitchAllowClickToSelectLockedStroke.IsOn;
SelectionV2.AllowClickToSelectLockedStroke = ToggleSwitchAllowClickToSelectLockedStroke.IsOn; FloatingToolBarV2.SelectionV2.AllowClickToSelectLockedStroke = ToggleSwitchAllowClickToSelectLockedStroke.IsOn;
SaveSettingsToFile(); SaveSettingsToFile();
} }
private void ComboBoxSelectionMethod_SelectionChanged(object sender, RoutedEventArgs e) { private void ComboBoxSelectionMethod_SelectionChanged(object sender, RoutedEventArgs e) {
if (!isLoaded) return; if (!isLoaded) return;
Settings.Canvas.SelectionMethod = ComboBoxSelectionMethod.SelectedIndex; Settings.Canvas.SelectionMethod = ComboBoxSelectionMethod.SelectedIndex;
SelectionV2.SelectionModeSelected = (SelectionPopup.SelectionMode)ComboBoxSelectionMethod.SelectedIndex; FloatingToolBarV2.SelectionV2.SelectionModeSelected = (SelectionPopup.SelectionMode)ComboBoxSelectionMethod.SelectedIndex;
SaveSettingsToFile(); SaveSettingsToFile();
} }

View File

@ -21,16 +21,6 @@ namespace Ink_Canvas {
if (lastBorderMouseDownObject != null && lastBorderMouseDownObject is Panel) if (lastBorderMouseDownObject != null && lastBorderMouseDownObject is Panel)
((Panel)lastBorderMouseDownObject).Background = new SolidColorBrush(Colors.Transparent); ((Panel)lastBorderMouseDownObject).Background = new SolidColorBrush(Colors.Transparent);
if (sender == ShapeDrawFloatingBarBtn && lastBorderMouseDownObject != ShapeDrawFloatingBarBtn) return; if (sender == ShapeDrawFloatingBarBtn && lastBorderMouseDownObject != ShapeDrawFloatingBarBtn) return;
if (ShapeDrawingPopupV2.IsOpen == false) {
var transform = ShapeDrawFloatingBarBtn.TransformToVisual(Main_Grid);
var pt = transform.Transform(new Point(0, 0));
ShapeDrawingPopupV2.VerticalOffset = pt.Y;
ShapeDrawingPopupV2.HorizontalOffset = pt.X - 32;
ShapeDrawingPopupV2.IsOpen = true;
} else {
HideSubPanels();
}
} }
#endregion Floating Bar Control #endregion Floating Bar Control
@ -1586,10 +1576,7 @@ namespace Ink_Canvas {
public void ShapeDrawingV2Init() { public void ShapeDrawingV2Init() {
ShapeDrawingV2Layer.MainWindow = this; ShapeDrawingV2Layer.MainWindow = this;
ShapeDrawingV2.ShapeDrawingPopupShouldCloseEvent += (sender, args) => { FloatingToolBarV2.ShapeDrawingV2_ShapeSelectedEvent += (sender, args) => {
ShapeDrawingPopupV2.IsOpen = false;
};
ShapeDrawingV2.ShapeSelectedEvent += (sender, args) => {
ShapeDrawingV2Layer.StartShapeDrawing(args.Type, args.Name); ShapeDrawingV2Layer.StartShapeDrawing(args.Type, args.Name);
}; };
} }

View File

@ -4,13 +4,15 @@
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:local="clr-namespace:Ink_Canvas" xmlns:local="clr-namespace:Ink_Canvas"
xmlns:popups="clr-namespace:Ink_Canvas.Popups"
Topmost="True" Loaded="FloatingBarV2_Loaded"
mc:Ignorable="d" WindowStyle="None" Background="Transparent" AllowsTransparency="True" ResizeMode="NoResize" mc:Ignorable="d" WindowStyle="None" Background="Transparent" AllowsTransparency="True" ResizeMode="NoResize"
Title="FloatingToolBarV2"> Title="FloatingToolBarV2">
<Window.Resources> <Window.Resources>
<DrawingImage x:Key="CursorIcon"> <DrawingImage x:Key="CursorIcon">
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V22 H22 V0 H0 Z"> <DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#222222" Geometry="F1 M22,22z M0,0z M21.7989,9.16526L0.143036,0.143036 9.16526,21.7989 11.8305,13.9518 18.6892,20.8105 20.8105,18.6892 13.9518,11.8305 21.7989,9.16526z" /> <GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M5.19409,16.3124C5.46422,18.0658 5.69121,19.539 5.8351,20.4621 5.9631,21.2477 6.80568,21.3359 7.22902,20.5643 7.93608,19.3044 9.20443,17.1009 10.0921,15.5636L14.9921,22.5615C15.1915,22.8462,15.5839,22.9154,15.8687,22.716L17.9309,21.272C18.2157,21.0727,18.2848,20.6802,18.0854,20.3955L13.5037,13.8522C15.6284,13.8519 18.6266,13.8518 20.2609,13.8524 21.1847,13.8201 21.258,12.9461 20.5777,12.4184 16.9666,9.91811 8.45126,4.12632 4.34164,1.42431 3.63839,0.928666 2.78717,1.12985 3.00557,2.27077 3.59731,5.94841 4.52718,11.9839 5.19409,16.3124z" />
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
@ -33,17 +35,16 @@
<DrawingImage x:Key="TrashBinIcon"> <DrawingImage x:Key="TrashBinIcon">
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z"> <DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M2.15454,7.07729L2.15454,5.1082 7.07727,5.1082 7.07727,4.12365C7.07727,3.30648 7.47109,2.57791 7.98305,2.0758 8.49501,1.56383 9.22358,1.17001 10.0309,1.17001L13.9691,1.17001C14.7863,1.17001 15.5148,1.56383 16.0169,2.0758 16.5289,2.58776 16.9227,3.31632 16.9227,4.12365L16.9227,5.1082 21.8454,5.1082 21.8454,7.07729 2.15454,7.07729z" /> <GeometryDrawing Brush="#e01b24" Geometry="F0 M24,24z M0,0z M8.82358,1.16992C8.5646,1.16992,8.33468,1.33565,8.25279,1.58133L7.5877,3.57659 1.77159,3.57659C1.4393,3.57659,1.16992,3.84597,1.16992,4.17826L1.16992,5.38159C1.16992,5.71388,1.4393,5.98326,1.77159,5.98326L22.2283,5.98326C22.5605,5.98326,22.8299,5.71388,22.8299,5.38159L22.8299,4.17826C22.8299,3.84597,22.5605,3.57659,22.2283,3.57659L16.4122,3.57659 15.7471,1.58133C15.6652,1.33565,15.4352,1.16992,15.1762,1.16992L8.82358,1.16992z M3.57659,7.78826L20.4233,7.78826 19.3085,21.7225C19.2584,22.3479,18.7364,22.8299,18.109,22.8299L5.89083,22.8299C5.26346,22.8299,4.74137,22.3479,4.69133,21.7225L3.57659,7.78826z M8.99159,11.9999C8.6593,11.9999,8.38992,12.2693,8.38992,12.6016L8.38992,17.4149C8.38992,17.7472,8.6593,18.0166,8.99159,18.0166L9.59326,18.0166C9.9255,18.0166,10.1949,17.7472,10.1949,17.4149L10.1949,12.6016C10.1949,12.2693,9.9255,11.9999,9.59326,11.9999L8.99159,11.9999z M13.8049,12.6016C13.8049,12.2693,14.0743,11.9999,14.4066,11.9999L15.0083,11.9999C15.3405,11.9999,15.6099,12.2693,15.6099,12.6016L15.6099,17.4149C15.6099,17.7472,15.3405,18.0166,15.0083,18.0166L14.4066,18.0166C14.0743,18.0166,13.8049,17.7472,13.8049,17.4149L13.8049,12.6016z" />
<GeometryDrawing Brush="#222222" Geometry="F0 M24,24z M0,0z M4.12363,19.7779C4.12363,20.6148 4.51745,21.3729 5.02941,21.8947 5.54138,22.4165 6.26994,22.83 7.07727,22.83L16.9227,22.83C17.7399,22.83 18.4685,22.4165 18.9706,21.8947 19.4825,21.3729 19.8764,20.6148 19.8764,19.7779L19.8764,8.06183 4.12363,8.06183 4.12363,19.7779z M12.9845,11.0155L14.9536,11.0155 14.9536,18.8918 12.9845,18.8918 12.9845,11.0155z M9.04636,11.0155L11.0154,11.0155 11.0154,18.8918 9.04636,18.8918 9.04636,11.0155z" />
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
<DrawingImage x:Key="ShapesIcon"> <DrawingImage x:Key="ShapesIcon">
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H16 V0 H0 Z"> <DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M12.2976,7.55061L7.97358,0.466797 3.63956,7.55061 12.2976,7.55061z" /> <GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M17.8613,10.7596L12.0077,1.16992 6.14056,10.7596 17.8613,10.7596z" />
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M7.18147,9.38298L0.0976562,9.38298 0.0976562,16.4668 7.18147,16.4668 7.18147,9.38298z" /> <GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M10.9354,13.2402L1.3457,13.2402 1.3457,22.8299 10.9354,22.8299 10.9354,13.2402z" />
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M12.2976,9.38298C10.3414,9.38298 8.75565,10.9687 8.75565,12.9249 8.75565,14.881 10.3414,16.4668 12.2976,16.4668 14.2537,16.4668 15.8395,14.881 15.8395,12.9249 15.8395,10.9687 14.2537,9.38298 12.2976,9.38298z" /> <GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M17.8613,13.2402C15.2132,13.2402 13.0665,15.3869 13.0665,18.0351 13.0665,20.6832 15.2132,22.8299 17.8613,22.8299 20.5094,22.8299 22.6562,20.6832 22.6562,18.0351 22.6562,15.3869 20.5094,13.2402 17.8613,13.2402z" />
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
@ -77,12 +78,17 @@
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
<DrawingImage x:Key="GestureIcon"> <DrawingImage x:Key="WhiteboardIcon">
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z"> <DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#222222" Geometry="F0 M24,24z M0,0z M7.82154,10.0753L7.82154,3.74613C7.82154,3.06603 8.08946,2.40655 8.57377,1.92224 9.05808,1.43793 9.70726,1.17001 10.3977,1.17001 11.0881,1.17001 11.7372,1.43793 12.2216,1.92224 12.7059,2.40655 12.9738,3.05573 12.9738,3.74613L12.9738,6.37308C13.1415,6.33947 13.3139,6.32225 13.489,6.32225 14.1794,6.32225 14.8286,6.59016 15.3129,7.07447 15.4484,7.21001 15.567,7.35845 15.6675,7.5171 15.9551,7.40916 16.2634,7.35269 16.5803,7.35269 17.2707,7.35269 17.9199,7.62061 18.4042,8.10492 18.5461,8.24683 18.6695,8.4029 18.7729,8.57001 19.6856,8.26338 20.7674,8.45871 21.4647,9.15599 21.949,9.6403 22.2169,10.2998 22.2169,10.9799L22.2169,15.6169C22.2169,17.5438 21.4647,19.3574 20.1045,20.7176 18.7443,22.0778 16.9307,22.83 15.0038,22.83L13.149,22.83C13.149,22.83 13.0039,22.83 12.7969,22.83 12.5898,22.83 10.7068,22.4694 9.75878,21.9541 8.70773,21.3874 7.81124,20.563 7.15175,19.5738L6.94566,19.2647C6.60562,18.7494 5.49273,16.8019 3.52458,13.3087 3.19484,12.7213 3.1021,12.0412 3.27727,11.3818 3.45245,10.7326 3.86463,10.1761 4.44168,9.83608 5.00842,9.49604 5.66791,9.35177 6.31709,9.43421 6.86548,9.50385 7.39181,9.7279 7.82154,10.0753z M10.037,3.38547C10.1297,3.28243 10.2637,3.23091 10.3977,3.23091 10.5316,3.23091 10.6656,3.29273 10.7583,3.38547 10.8614,3.47821 10.9129,3.61217 10.9129,3.74613L10.9129,11.4745C10.9129,12.0412 11.3766,12.5049 11.9433,12.5049 12.5101,12.5049 12.9738,12.0412 12.9738,11.4745L12.9738,8.89836C12.9738,8.7644 13.0356,8.63045 13.1283,8.53771 13.2211,8.43466 13.355,8.38314 13.489,8.38314 13.623,8.38314 13.7569,8.44497 13.8497,8.53771 13.9527,8.63045 14.0042,8.7644 14.0042,8.89836L14.0042,11.4745C14.0042,12.0412 14.4679,12.5049 15.0347,12.5049 15.6014,12.5049 16.0651,12.0412 16.0651,11.4745L16.0651,9.92881C16.0651,9.79485 16.1269,9.66089 16.2197,9.56815 16.3124,9.46511 16.4464,9.41359 16.5803,9.41359 16.7143,9.41359 16.8483,9.47541 16.941,9.56815 17.044,9.66089 17.0956,9.79485 17.0956,9.92881L17.0956,10.5869C17.0752,10.7163 17.0646,10.8477 17.0646,10.9799 17.0646,11.0661 17.0754,11.1499 17.0956,11.2301L17.0956,11.4745C17.0956,12.0412 17.5593,12.5049 18.126,12.5049 18.6928,12.5049 19.1565,12.0412 19.1565,11.4745L19.1565,10.8128C19.1834,10.7399 19.2266,10.6727 19.2801,10.6192 19.4759,10.4234 19.8159,10.4234 20.0117,10.6192 20.1148,10.712 20.1663,10.8459 20.1663,10.9799L20.1663,15.6169C20.1663,16.9977 19.6408,18.296 18.6618,19.2647 17.6829,20.2333 16.3949,20.7691 15.0141,20.7691L13.1593,20.7691C12.3143,20.7691 11.4796,20.5527 10.7274,20.1509 9.98548,19.749 9.3363,19.1616 8.8726,18.4506L8.66651,18.1415C8.35737,17.6675 7.23419,15.7096 5.31756,12.2989 5.24543,12.1752 5.23512,12.0412 5.26604,11.9073 5.30725,11.7733 5.38969,11.6703 5.50304,11.5981 5.66791,11.4951 5.874,11.4539 6.06978,11.4745 6.26557,11.5054 6.45105,11.5878 6.59531,11.7321L8.11007,13.2469C8.49419,13.631 9.10425,13.648 9.50833,13.2978 9.73651,13.1084 9.88244,12.8229 9.88244,12.5049L9.88244,3.74613C9.88244,3.61217,9.94426,3.47821,10.037,3.38547z" /> <GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M10.6784,2.72682C10.6784,2.24019,11.0728,1.8457,11.5594,1.8457L12.5245,1.8457C13.0111,1.8457,13.4056,2.24019,13.4056,2.72682L13.4056,3.60777 23.4545,3.60777C23.7557,3.60777,24,3.85198,24,4.15323L24,5.78959C24,6.09083,23.7557,6.33505,23.4545,6.33505L21.8182,6.33505 21.8182,16.0171C21.8182,16.9962,21.019,17.7898,20.033,17.7898L13.3216,17.7898 13.3216,19.4261 15.8182,19.4261C16.1194,19.4261,16.3636,19.6703,16.3636,19.9715L16.3636,21.6079C16.3636,21.9092,16.1194,22.1533,15.8182,22.1533L8.1818,22.1533C7.88055,22.1533,7.63634,21.9092,7.63634,21.6079L7.63634,19.9715C7.63634,19.6703,7.88055,19.4261,8.1818,19.4261L10.5944,19.4261 10.5944,17.7898 3.96693,17.7898C2.98103,17.7898,2.1818,16.9962,2.1818,16.0171L2.1818,6.33505 0.545455,6.33505C0.244211,6.33505,0,6.09083,0,5.78959L0,4.15323C0,3.85198,0.244211,3.60777,0.545455,3.60777L10.6784,3.60777 10.6784,2.72682z" />
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M2.99905,6.31195L1.78313,4.65293 2.61779,4.04497C3.46275,3.4267,4.37985,2.89087,5.33817,2.46838L6.27587,2.0459 7.12084,3.93162 6.18313,4.3541C5.35878,4.72506,4.56533,5.17846,3.83372,5.71429L2.99905,6.32225 2.99905,6.31195z" /> </DrawingGroup>
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M18.2806,5.20935L19.1565,5.75549 20.259,4.01404 19.3832,3.4679C18.1157,2.67446,16.7452,2.0768,15.3026,1.68523L14.303,1.41731 13.7672,3.40607 14.7667,3.67399C16.0033,4.00373,17.1883,4.51895,18.2806,5.20935z" /> </DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="GestureIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V25 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M24,25z M0,0z M5.23338,7.02449C5.23338,4.04984 7.67384,1.60938 10.6485,1.60938 13.6231,1.60938 16.0636,4.04984 16.0636,7.02449 16.0636,8.71614 15.2582,10.2172 14.0303,11.2128L13.6839,11.1255C13.5766,11.0989,13.4665,11.0856,13.356,11.0858L13.356,7.02449C13.356,5.54792 12.1251,4.31693 10.6485,4.31693 9.17192,4.31693 7.94093,5.54792 7.94093,7.02449L7.94093,11.6807C6.33328,10.7381,5.23338,9.00996,5.23338,7.02449z M10.1933,5.76784C10.3209,5.72261 10.4546,5.69679 10.5899,5.69122 10.68,5.68674 10.7704,5.69093 10.8596,5.70442 10.9041,5.71191 10.9482,5.72163 10.9918,5.73353 11.0356,5.74458 11.0788,5.75783 11.1213,5.77321 11.1637,5.78962 11.2052,5.80814 11.2456,5.82872 11.2863,5.84789 11.326,5.86907 11.3646,5.8922 11.4795,5.96446 11.5829,6.05361 11.6713,6.15663 11.7004,6.1905 11.7277,6.22578 11.7533,6.26235 11.832,6.37325 11.8935,6.49537 11.9357,6.62459 11.9776,6.75361 11.9999,6.8882 12.0018,7.02385L12.0018,12.439 13.3556,12.439C13.4661,12.4388,13.5762,12.4521,13.6835,12.4786L19.0986,13.8324C19.3917,13.9056 19.6519,14.0747 19.8378,14.3128 20.0237,14.5509 20.1246,14.8444 20.1245,15.1465L20.1245,20.5616C20.1245,21.6898 19.3607,22.6265 18.6993,22.9572 18.038,23.2879 17.417,23.2692 17.417,23.2692L10.6481,23.2692C10.6287,23.2688 10.6093,23.2681 10.5899,23.2669 10.5528,23.2657 10.5157,23.263 10.4788,23.2588 10.4674,23.2571 10.4559,23.2553 10.4445,23.2533 10.4179,23.2488 10.3914,23.2436 10.3651,23.2375 10.3421,23.2328 10.3192,23.2275 10.2964,23.2217 10.2831,23.2183 10.2699,23.2146 10.2567,23.2108 10.2282,23.2021 10.2,23.1924 10.1721,23.1817 10.1552,23.175 10.1385,23.168 10.1219,23.1606 10.0969,23.1499 10.0722,23.1384 10.0478,23.1262 10.0273,23.1162 10.007,23.1056 9.98704,23.0945 9.97099,23.0861 9.95513,23.0773 9.93944,23.0681 9.91789,23.0547 9.89673,23.0406 9.87598,23.0259 9.86261,23.0173 9.84939,23.0085 9.83632,22.9995L9.80724,22.9757 4.42121,18.9382C4.14989,18.7357 3.96425,18.439 3.90089,18.1064 3.83752,17.7739 3.90103,17.4297 4.07889,17.1417 4.25676,16.8536 4.53607,16.6427 4.86177,16.5504 5.18747,16.4581 5.53593,16.4912 5.83845,16.6431L9.29429,18.3723 9.29429,13.7927 9.29429,7.02385C9.2949,6.97253 9.29843,6.9213 9.30486,6.87039 9.3106,6.82593 9.31854,6.78179 9.32866,6.73812 9.36928,6.56187 9.4448,6.39554 9.55076,6.24896 9.63093,6.1391 9.7272,6.04194 9.83633,5.96076 9.87205,5.93338 9.90911,5.90782 9.94738,5.88414 10.0252,5.83722 10.1076,5.79825 10.1933,5.76784z" />
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
@ -105,80 +111,114 @@
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
</Window.Resources> </Window.Resources>
<Grid Name="ToolbarV2" RenderTransformOrigin=".5,.5"> <Grid>
<Grid Name="ToolBarV2Grid" HorizontalAlignment="Left" Margin="6" Height="48"> <Grid>
<DockPanel> <Popup Name="PenPaletteV2Popup" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Relative">
<DockPanel.Effect> <popups:ColorPalette Loaded="PenPaletteV2_Loaded" x:Name="PenPaletteV2" Width="300" />
<DropShadowEffect Opacity="0.3" ShadowDepth="1"></DropShadowEffect> </Popup>
</DockPanel.Effect> </Grid>
<Image DockPanel.Dock="Left" Height="48" HorizontalAlignment="Left"> <Grid>
<Popup Name="SelectionPopupV2" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Relative">
<popups:SelectionPopup Loaded="SelectionV2_Loaded" x:Name="SelectionV2" Width="300" />
</Popup>
</Grid>
<Grid>
<Popup Name="ShapeDrawingPopupV2" PopupAnimation="Fade" IsOpen="False" StaysOpen="True" AllowsTransparency="True" Placement="Relative">
<popups:ShapeDrawingPopup Loaded="ShapeDrawingV2_Loaded" x:Name="ShapeDrawingV2" Width="570" />
</Popup>
</Grid>
<Grid Name="ToolbarV2" RenderTransformOrigin=".5,.5">
<Grid Name="ToolBarV2Grid" HorizontalAlignment="Left" Margin="24" Height="48">
<DockPanel Name="FallbackBackgroundLayer">
<DockPanel.Effect>
<DropShadowEffect Opacity="0.01" Direction="0" ShadowDepth="0.1" BlurRadius="0.01"></DropShadowEffect>
</DockPanel.Effect>
<Image DockPanel.Dock="Left" Height="48" HorizontalAlignment="Left">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V120 H63 V0 H0 Z">
<GeometryDrawing Brush="#fafafa" Geometry="F1 M63,120z M0,0z M62.6465,-0.00390625L60.3128,-0.00390625C34.3338,-0.00390625 21.3443,-0.00390625 12.5491,7.09435 10.7817,8.52078 9.17117,10.1313 7.74474,11.8988 0.646484,20.6939 0.646484,33.6834 0.646484,59.6624 0.646484,85.6414 0.646484,98.6309 7.74474,107.426 9.17117,109.194 10.7817,110.804 12.5491,112.23 21.3443,119.329 34.3338,119.329 60.3128,119.329L62.6465,119.329 62.6465,-0.00390625z"/>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Image DockPanel.Dock="Right" Height="48" HorizontalAlignment="Left">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V120 H63 V0 H0 Z">
<GeometryDrawing Brush="#fafafa" Geometry="F1 M63,120z M0,0z M0.447266,119.495L2.78091,119.495C28.7599,119.495 41.7495,119.495 50.5446,112.396 52.312,110.97 53.9226,109.36 55.349,107.592 62.4473,98.797 62.4473,85.8074 62.4473,59.8284 62.4473,33.8494 62.4473,20.8599 55.349,12.0648 53.9226,10.2973 52.312,8.6868 50.5446,7.26037 41.7495,0.162109 28.7599,0.162109 2.78091,0.162109L0.447266,0.162109 0.447266,119.495z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Border Background="#fafafa" Height="48" Margin="-1,0,-1,0.25" VerticalAlignment="Center"></Border>
</DockPanel>
<Image Name="MainBackgroundLayer">
<Image.Source> <Image.Source>
<DrawingImage> <DrawingImage>
<DrawingImage.Drawing> <DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V120 H63 V0 H0 Z"> <DrawingGroup x:Name="BackgroundBorderDrawingGroup">
<GeometryDrawing Brush="#fafafa" Geometry="F1 M63,120z M0,0z M62.6465,-0.00390625L60.3128,-0.00390625C34.3338,-0.00390625 21.3443,-0.00390625 12.5491,7.09435 10.7817,8.52078 9.17117,10.1313 7.74474,11.8988 0.646484,20.6939 0.646484,33.6834 0.646484,59.6624 0.646484,85.6414 0.646484,98.6309 7.74474,107.426 9.17117,109.194 10.7817,110.804 12.5491,112.23 21.3443,119.329 34.3338,119.329 60.3128,119.329L62.6465,119.329 62.6465,-0.00390625z" /> <GeometryDrawing Brush="#fafafa" x:Name="ToolBarBackgroundBorder">
<GeometryDrawing.Pen>
<Pen Brush="#d4d4d8" Thickness="3"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup> </DrawingGroup>
</DrawingImage.Drawing> </DrawingImage.Drawing>
</DrawingImage> </DrawingImage>
</Image.Source> </Image.Source>
</Image> </Image>
<Image DockPanel.Dock="Right" Height="48" HorizontalAlignment="Left"> <StackPanel Orientation="Horizontal" Margin="4,0">
<Image.Source> <Grid Name="HeadIcon" RenderTransformOrigin=".5,.5" MouseMove="HeadIconButton_MouseMove" MouseDown="HeadIconButton_MouseDown" MouseUp="HeadIconButton_MouseUp" Width="42" Height="42" Margin="0,0,2,0">
<DrawingImage> <Image Name="HeadIconImage" Height="42" Width="42" Source="../Resources/Icons-png/icc-toolbar-v2.png" RenderOptions.BitmapScalingMode="HighQuality"></Image>
<DrawingImage.Drawing> </Grid>
<DrawingGroup ClipGeometry="M0,0 V120 H63 V0 H0 Z"> <ItemsControl Name="ToolBarItemsControl">
<GeometryDrawing Brush="#fafafa" Geometry="F1 M63,120z M0,0z M0.447266,119.495L2.78091,119.495C28.7599,119.495 41.7495,119.495 50.5446,112.396 52.312,110.97 53.9226,109.36 55.349,107.592 62.4473,98.797 62.4473,85.8074 62.4473,59.8284 62.4473,33.8494 62.4473,20.8599 55.349,12.0648 53.9226,10.2973 52.312,8.6868 50.5446,7.26037 41.7495,0.162109 28.7599,0.162109 2.78091,0.162109L0.447266,0.162109 0.447266,119.495z" /> <ItemsControl.ItemsPanel>
</DrawingGroup> <ItemsPanelTemplate>
</DrawingImage.Drawing> <StackPanel Orientation="Horizontal"></StackPanel>
</DrawingImage> </ItemsPanelTemplate>
</Image.Source> </ItemsControl.ItemsPanel>
</Image> <ItemsControl.ItemTemplate>
<Border Background="#fafafa" Height="48" Margin="-1,0,-1,0.25" VerticalAlignment="Center"></Border> <DataTemplate DataType="{x:Type local:FloatingBarItem}">
</DockPanel> <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Margin="4,0"> <Grid RenderTransformOrigin=".5,.5" MouseDown="ToolbarButton_MouseDown" MouseUp="ToolbarButton_MouseUp" MouseLeave="ToolbarButton_MouseLeave" Tag="{Binding}" Visibility="{Binding _itemVisibility}" Margin="2,0,0,0" Width="42" Height="42">
<Grid Name="HeadIcon" RenderTransformOrigin=".5,.5" MouseMove="HeadIconButton_MouseMove" MouseDown="HeadIconButton_MouseDown" MouseUp="HeadIconButton_MouseUp" Width="42" Height="42" Margin="0,0,2,0"> <Image Height="42" Width="42">
<Image Name="HeadIconImage" Height="42" Width="42" Source="../Resources/Icons-png/icc-toolbar-v2.png" RenderOptions.BitmapScalingMode="HighQuality"></Image> <Image.Source>
</Grid> <DrawingImage>
<ItemsControl Name="ToolBarItemsControl"> <DrawingImage.Drawing>
<ItemsControl.ItemsPanel> <DrawingGroup ClipGeometry="M0,0 V120 H120 V0 H0 Z">
<ItemsPanelTemplate> <GeometryDrawing Brush="{Binding _backgroundBrush}" Geometry="F1 M120,120z M0,0z M0.443359,59.9384C0.443359,33.9607 0.443359,20.9718 7.54095,12.1769 8.96777,10.4089 10.5788,8.79785 12.3468,7.37103 21.1418,0.273438 34.1306,0.273438 60.1084,0.273438 86.0861,0.273438 99.075,0.273438 107.87,7.37103 109.638,8.79785 111.249,10.4089 112.676,12.1769 119.773,20.9718 119.773,33.9607 119.773,59.9384 119.773,85.9162 119.773,98.905 112.676,107.7 111.249,109.468 109.638,111.079 107.87,112.506 99.075,119.603 86.0861,119.603 60.1084,119.603 34.1306,119.603 21.1418,119.603 12.3468,112.506 10.5788,111.079 8.96777,109.468 7.54095,107.7 0.443359,98.905 0.443359,85.9162 0.443359,59.9384z" />
<StackPanel Orientation="Horizontal"></StackPanel> </DrawingGroup>
</ItemsPanelTemplate> </DrawingImage.Drawing>
</ItemsControl.ItemsPanel> </DrawingImage>
<ItemsControl.ItemTemplate> </Image.Source>
<DataTemplate DataType="{x:Type local:FloatingBarItem}"> </Image>
<StackPanel Orientation="Horizontal"> <Image Height="42" Width="42" Opacity="0">
<Grid MouseDown="ToolbarButton_MouseDown" MouseUp="ToolbarButton_MouseUp" MouseLeave="ToolbarButton_MouseLeave" Tag="{Binding}" Visibility="{Binding _itemVisibility}" Margin="2,0,0,0" Width="42" Height="42"> <Image.Source>
<Image Height="42" Width="42"> <DrawingImage>
<Image.Source> <DrawingImage.Drawing>
<DrawingImage> <DrawingGroup ClipGeometry="M0,0 V120 H120 V0 H0 Z">
<DrawingImage.Drawing> <GeometryDrawing Brush="{Binding _pressFeedbackColorBrush}" Geometry="F1 M120,120z M0,0z M0.443359,59.9384C0.443359,33.9607 0.443359,20.9718 7.54095,12.1769 8.96777,10.4089 10.5788,8.79785 12.3468,7.37103 21.1418,0.273438 34.1306,0.273438 60.1084,0.273438 86.0861,0.273438 99.075,0.273438 107.87,7.37103 109.638,8.79785 111.249,10.4089 112.676,12.1769 119.773,20.9718 119.773,33.9607 119.773,59.9384 119.773,85.9162 119.773,98.905 112.676,107.7 111.249,109.468 109.638,111.079 107.87,112.506 99.075,119.603 86.0861,119.603 60.1084,119.603 34.1306,119.603 21.1418,119.603 12.3468,112.506 10.5788,111.079 8.96777,109.468 7.54095,107.7 0.443359,98.905 0.443359,85.9162 0.443359,59.9384z" />
<DrawingGroup ClipGeometry="M0,0 V120 H120 V0 H0 Z"> </DrawingGroup>
<GeometryDrawing Brush="{Binding _backgroundBrush}" Geometry="F1 M120,120z M0,0z M0.443359,59.9384C0.443359,33.9607 0.443359,20.9718 7.54095,12.1769 8.96777,10.4089 10.5788,8.79785 12.3468,7.37103 21.1418,0.273438 34.1306,0.273438 60.1084,0.273438 86.0861,0.273438 99.075,0.273438 107.87,7.37103 109.638,8.79785 111.249,10.4089 112.676,12.1769 119.773,20.9718 119.773,33.9607 119.773,59.9384 119.773,85.9162 119.773,98.905 112.676,107.7 111.249,109.468 109.638,111.079 107.87,112.506 99.075,119.603 86.0861,119.603 60.1084,119.603 34.1306,119.603 21.1418,119.603 12.3468,112.506 10.5788,111.079 8.96777,109.468 7.54095,107.7 0.443359,98.905 0.443359,85.9162 0.443359,59.9384z" /> </DrawingImage.Drawing>
</DrawingGroup> </DrawingImage>
</DrawingImage.Drawing> </Image.Source>
</DrawingImage> </Image>
</Image.Source> <Image Height="{Binding IconHeight}" Source="{Binding IconSource}"/>
</Image> </Grid>
<Image Height="42" Width="42" Opacity="0"> <Border Opacity="{Binding _separatorOpacity}" Visibility="{Binding _separatorVisibility}" Width="1" Height="28" CornerRadius="0.5" Background="#e1e1e1" Margin="3,0,1,0"></Border>
<Image.Source> </StackPanel>
<DrawingImage> </DataTemplate>
<DrawingImage.Drawing> </ItemsControl.ItemTemplate>
<DrawingGroup ClipGeometry="M0,0 V120 H120 V0 H0 Z"> </ItemsControl>
<GeometryDrawing Brush="#e1e1e1" Geometry="F1 M120,120z M0,0z M0.443359,59.9384C0.443359,33.9607 0.443359,20.9718 7.54095,12.1769 8.96777,10.4089 10.5788,8.79785 12.3468,7.37103 21.1418,0.273438 34.1306,0.273438 60.1084,0.273438 86.0861,0.273438 99.075,0.273438 107.87,7.37103 109.638,8.79785 111.249,10.4089 112.676,12.1769 119.773,20.9718 119.773,33.9607 119.773,59.9384 119.773,85.9162 119.773,98.905 112.676,107.7 111.249,109.468 109.638,111.079 107.87,112.506 99.075,119.603 86.0861,119.603 60.1084,119.603 34.1306,119.603 21.1418,119.603 12.3468,112.506 10.5788,111.079 8.96777,109.468 7.54095,107.7 0.443359,98.905 0.443359,85.9162 0.443359,59.9384z" /> </StackPanel>
</DrawingGroup> </Grid>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Image Height="21" Source="{Binding IconSource}"/>
</Grid>
<Border Visibility="{Binding _separatorVisibility}" Width="1" Height="28" CornerRadius="0.5" Background="#e1e1e1" Margin="3,0,1,0"></Border>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid> </Grid>
</Grid> </Grid>
</Window> </Window>

View File

@ -9,12 +9,16 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using static Ink_Canvas.Popups.ColorPalette;
using static Ink_Canvas.Popups.SelectionPopup;
using static Ink_Canvas.Popups.ShapeDrawingPopup;
namespace Ink_Canvas namespace Ink_Canvas
{ {
@ -31,11 +35,15 @@ namespace Ink_Canvas
public bool Selected { get; set; } = false; public bool Selected { get; set; } = false;
public bool IsVisible { get; set; } = true; public bool IsVisible { get; set; } = true;
public string IconSourceResourceKey { get; set; } public string IconSourceResourceKey { get; set; }
public double IconHeight { get; set; } = 21;
public Color? IconColor { get; set; } = null; // 该属性仅用于纯色图标用于在动态透明模式下恢复图标原来的自定义颜色
public bool IsSemiTransparent { get; set; } = false;
public Color? PressFeedbackColor { get; set; } = null;
public FloatingBarItemType Type { get; set; } public FloatingBarItemType Type { get; set; }
public MainWindow.ICCToolsEnum ToolType { get; set; } public MainWindow.ICCToolsEnum ToolType { get; set; }
public SolidColorBrush _backgroundBrush { public SolidColorBrush _backgroundBrush {
get { get {
if (Selected) return new SolidColorBrush(Color.FromRgb(37, 99, 235)); if (Selected) return new SolidColorBrush(Color.FromArgb((byte)(IsSemiTransparent ? 128 : 255) ,37, 99, 235));
return new SolidColorBrush(Colors.Transparent); return new SolidColorBrush(Colors.Transparent);
} }
} }
@ -51,6 +59,16 @@ namespace Ink_Canvas
return Type != FloatingBarItemType.Separator ? Visibility.Collapsed : Visibility.Visible; return Type != FloatingBarItemType.Separator ? Visibility.Collapsed : Visibility.Visible;
} }
} }
public double _separatorOpacity {
get => IsSemiTransparent ? 0.35 : 1;
}
public SolidColorBrush _pressFeedbackColorBrush {
get {
if (PressFeedbackColor == null) return new SolidColorBrush(Color.FromArgb((byte)(IsSemiTransparent ? 96 : 255),225, 225, 225));
return new SolidColorBrush(Color.FromArgb((byte)(IsSemiTransparent ? 96 : 255),((Color)PressFeedbackColor).R,
((Color)PressFeedbackColor).G, ((Color)PressFeedbackColor).B));
}
}
} }
/// <summary> /// <summary>
@ -71,6 +89,7 @@ namespace Ink_Canvas
IconSourceResourceKey = "CursorIcon", IconSourceResourceKey = "CursorIcon",
IsVisible = true, IsVisible = true,
Selected = false, Selected = false,
IconHeight = 21.5,
ToolType = MainWindow.ICCToolsEnum.CursorMode, ToolType = MainWindow.ICCToolsEnum.CursorMode,
Type = FloatingBarItemType.StateButton, Type = FloatingBarItemType.StateButton,
}); });
@ -79,6 +98,7 @@ namespace Ink_Canvas
IconSource = FindResource("PenIcon") as DrawingImage, IconSource = FindResource("PenIcon") as DrawingImage,
IconSourceResourceKey = "PenIcon", IconSourceResourceKey = "PenIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
ToolType = MainWindow.ICCToolsEnum.PenMode, ToolType = MainWindow.ICCToolsEnum.PenMode,
Type = FloatingBarItemType.StateButton, Type = FloatingBarItemType.StateButton,
@ -88,7 +108,10 @@ namespace Ink_Canvas
IconSource = FindResource("TrashBinIcon") as DrawingImage, IconSource = FindResource("TrashBinIcon") as DrawingImage,
IconSourceResourceKey = "TrashBinIcon", IconSourceResourceKey = "TrashBinIcon",
IsVisible = true, IsVisible = true,
IconColor = Color.FromRgb(224, 27, 36),
IconHeight = 22,
Selected = false, Selected = false,
PressFeedbackColor = Color.FromRgb(254, 226, 226),
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
ToolbarItems.Add(new FloatingBarItem() { ToolbarItems.Add(new FloatingBarItem() {
@ -101,6 +124,7 @@ namespace Ink_Canvas
IconSource = FindResource("EraserIcon") as DrawingImage, IconSource = FindResource("EraserIcon") as DrawingImage,
IconSourceResourceKey = "EraserIcon", IconSourceResourceKey = "EraserIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
ToolType = MainWindow.ICCToolsEnum.EraseByGeometryMode, ToolType = MainWindow.ICCToolsEnum.EraseByGeometryMode,
Type = FloatingBarItemType.StateButton, Type = FloatingBarItemType.StateButton,
@ -110,6 +134,7 @@ namespace Ink_Canvas
IconSource = FindResource("ShapesIcon") as DrawingImage, IconSource = FindResource("ShapesIcon") as DrawingImage,
IconSourceResourceKey = "ShapesIcon", IconSourceResourceKey = "ShapesIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -118,6 +143,7 @@ namespace Ink_Canvas
IconSource = FindResource("SelectIcon") as DrawingImage, IconSource = FindResource("SelectIcon") as DrawingImage,
IconSourceResourceKey = "SelectIcon", IconSourceResourceKey = "SelectIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
ToolType = MainWindow.ICCToolsEnum.LassoMode, ToolType = MainWindow.ICCToolsEnum.LassoMode,
Type = FloatingBarItemType.StateButton, Type = FloatingBarItemType.StateButton,
@ -132,6 +158,7 @@ namespace Ink_Canvas
IconSource = FindResource("UndoIcon") as DrawingImage, IconSource = FindResource("UndoIcon") as DrawingImage,
IconSourceResourceKey = "UndoIcon", IconSourceResourceKey = "UndoIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -140,6 +167,7 @@ namespace Ink_Canvas
IconSource = FindResource("RedoIcon") as DrawingImage, IconSource = FindResource("RedoIcon") as DrawingImage,
IconSourceResourceKey = "RedoIcon", IconSourceResourceKey = "RedoIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -148,11 +176,21 @@ namespace Ink_Canvas
IsVisible = true, IsVisible = true,
Type = FloatingBarItemType.Separator, Type = FloatingBarItemType.Separator,
}); });
ToolbarItems.Add(new FloatingBarItem() {
Name = "Whiteboard",
IconSource = FindResource("WhiteboardIcon") as DrawingImage,
IconSourceResourceKey = "WhiteboardIcon",
IsVisible = true,
IconHeight = 21.5,
Selected = false,
Type = FloatingBarItemType.Button,
});
ToolbarItems.Add(new FloatingBarItem() { ToolbarItems.Add(new FloatingBarItem() {
Name = "Gesture", Name = "Gesture",
IconSource = FindResource("GestureIcon") as DrawingImage, IconSource = FindResource("GestureIcon") as DrawingImage,
IconSourceResourceKey = "GestureIcon", IconSourceResourceKey = "GestureIcon",
IsVisible = true, IsVisible = true,
IconHeight = 23,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -161,6 +199,7 @@ namespace Ink_Canvas
IconSource = FindResource("MoreIcon") as DrawingImage, IconSource = FindResource("MoreIcon") as DrawingImage,
IconSourceResourceKey = "MoreIcon", IconSourceResourceKey = "MoreIcon",
IsVisible = true, IsVisible = true,
IconHeight = 21.5,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -169,6 +208,7 @@ namespace Ink_Canvas
IconSource = FindResource("FoldIcon") as DrawingImage, IconSource = FindResource("FoldIcon") as DrawingImage,
IconSourceResourceKey = "FoldIcon", IconSourceResourceKey = "FoldIcon",
IsVisible = true, IsVisible = true,
IconHeight = 22.5,
Selected = false, Selected = false,
Type = FloatingBarItemType.Button, Type = FloatingBarItemType.Button,
}); });
@ -176,6 +216,7 @@ namespace Ink_Canvas
ReMeasureToolBar(); ReMeasureToolBar();
UpdateToolBarSelectedTool(MainWindow.ICCToolsEnum.CursorMode); UpdateToolBarSelectedTool(MainWindow.ICCToolsEnum.CursorMode);
UpdateToolBarVariant(1); UpdateToolBarVariant(1);
UpdateToolBarDynamicOpacityVariant(1);
double widthInDevicePixels = GetSystemMetrics(0); // SM_CXSCREEN double widthInDevicePixels = GetSystemMetrics(0); // SM_CXSCREEN
double widthInDIP = SystemParameters.WorkArea.Right; // Device independent pixels. double widthInDIP = SystemParameters.WorkArea.Right; // Device independent pixels.
@ -184,6 +225,122 @@ namespace Ink_Canvas
} }
public void FloatingBarV2_Loaded(object sender, RoutedEventArgs e) {
}
public void HideAllPopups() {
PenPaletteV2Popup.IsOpen = false;
SelectionPopupV2.IsOpen = false;
ShapeDrawingPopupV2.IsOpen = false;
}
#region PopupV2
/// <summary>
/// 绑定调色盘V2的事件部分事件会在内部进行处理后转发到外部
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PenPaletteV2_Loaded(object sender, RoutedEventArgs e) {
PenPaletteV2.ColorSelectionChanged += (o, args) => {
PenPaletteV2_ColorSelectionChanged?.Invoke(o, args);
};
PenPaletteV2.CustomColorChanged += (o, args) => {
PenPaletteV2_CustomColorChanged?.Invoke(o, args);
};
PenPaletteV2.PenModeChanged += (o, args) => {
PenPaletteV2_PenModeChanged?.Invoke(o, args);
};
PenPaletteV2.InkRecognitionChanged += (o, args) => {
PenPaletteV2_InkRecognitionChanged?.Invoke(o, args);
};
PenPaletteV2.PressureSimulationChanged += (o, args) => {
PenPaletteV2_PressureSimulationChanged?.Invoke(o, args);
};
PenPaletteV2.ColorModeChanged += (o, args) => {
PenPaletteV2_ColorModeChanged?.Invoke(o, args);
};
PenPaletteV2.QuickActionsVisibilityChanged += (o, args) => {
PenPaletteV2_QuickActionsVisibilityChanged?.Invoke(o, args);
};
PenPaletteV2.PaletteShouldCloseEvent += (o, args) => {
PenPaletteV2Popup.IsOpen = false;
PenPaletteV2_PaletteShouldCloseEvent?.Invoke(o, args);
};
}
public event EventHandler<ColorSelectionChangedEventArgs> PenPaletteV2_ColorSelectionChanged;
public event EventHandler<CustomColorChangedEventArgs> PenPaletteV2_CustomColorChanged;
public event EventHandler<PenModeChangedEventArgs> PenPaletteV2_PenModeChanged;
public event EventHandler<InkRecognitionChangedEventArgs> PenPaletteV2_InkRecognitionChanged;
public event EventHandler<PressureSimulationChangedEventArgs> PenPaletteV2_PressureSimulationChanged;
public event EventHandler<ColorModeChangedEventArgs> PenPaletteV2_ColorModeChanged;
public event EventHandler<QuickActionsVisibilityChangedEventsArgs> PenPaletteV2_QuickActionsVisibilityChanged;
public event EventHandler<RoutedEventArgs> PenPaletteV2_PaletteShouldCloseEvent;
/// <summary>
/// 绑定选择弹窗V2的事件部分事件会在内部进行处理后转发到外部
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SelectionV2_Loaded(object sender, RoutedEventArgs e) {
SelectionV2.SelectionPopupShouldCloseEvent += (o, args) => {
SelectionPopupV2.IsOpen = false;
SelectionV2_SelectionPopupShouldCloseEvent?.Invoke(o, args);
};
SelectionV2.SelectAllEvent += (o, args) => {
SelectionV2_SelectAllEvent?.Invoke(o, args);
};
SelectionV2.UnSelectEvent += (o, args) => {
SelectionV2_UnSelectEvent?.Invoke(o, args);
};
SelectionV2.ReverseSelectEvent += (o, args) => {
SelectionV2_ReverseSelectEvent?.Invoke(o, args);
};
SelectionV2.ApplyScaleToStylusTipChanged += (o, args) => {
SelectionV2_ApplyScaleToStylusTipChanged?.Invoke(o, args);
};
SelectionV2.OnlyHitTestFullyContainedStrokesChanged += (o, args) => {
SelectionV2_OnlyHitTestFullyContainedStrokesChanged?.Invoke(o, args);
};
SelectionV2.AllowClickToSelectLockedStrokeChanged += (o, args) => {
SelectionV2_AllowClickToSelectLockedStrokeChanged?.Invoke(o, args);
};
SelectionV2.SelectionModeChanged += (o, args) => {
SelectionV2_SelectionModeChanged?.Invoke(o, args);
};
}
public event EventHandler<RoutedEventArgs> SelectionV2_SelectionPopupShouldCloseEvent;
public event EventHandler<RoutedEventArgs> SelectionV2_SelectAllEvent;
public event EventHandler<RoutedEventArgs> SelectionV2_UnSelectEvent;
public event EventHandler<RoutedEventArgs> SelectionV2_ReverseSelectEvent;
public event EventHandler<RoutedEventArgs> SelectionV2_ApplyScaleToStylusTipChanged;
public event EventHandler<RoutedEventArgs> SelectionV2_OnlyHitTestFullyContainedStrokesChanged;
public event EventHandler<RoutedEventArgs> SelectionV2_AllowClickToSelectLockedStrokeChanged;
public event EventHandler<SelectionModeChangedEventArgs> SelectionV2_SelectionModeChanged;
/// <summary>
/// 绑定形状绘制弹窗V2的事件部分事件会在内部进行处理后转发到外部
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ShapeDrawingV2_Loaded(object sender, RoutedEventArgs e) {
ShapeDrawingV2.ShapeDrawingPopupShouldCloseEvent += (o, args) => {
ShapeDrawingPopupV2.IsOpen = false;
ShapeDrawingV2_ShapeDrawingPopupShouldCloseEvent?.Invoke(o, args);
};
ShapeDrawingV2.ShapeSelectedEvent += (o, args) => {
ShapeDrawingV2_ShapeSelectedEvent?.Invoke(o, args);
};
}
public event EventHandler<RoutedEventArgs> ShapeDrawingV2_ShapeDrawingPopupShouldCloseEvent;
public event EventHandler<ShapeSelectedEventArgs> ShapeDrawingV2_ShapeSelectedEvent;
#endregion
private double ScalingFactor; private double ScalingFactor;
public ObservableCollection<FloatingBarItem> ToolbarItems { get; set; } = public ObservableCollection<FloatingBarItem> ToolbarItems { get; set; } =
@ -215,19 +372,24 @@ namespace Ink_Canvas
/// <summary> /// <summary>
/// 修改工具栏的变体 /// 修改工具栏的变体
/// </summary> /// </summary>
/// <param name="variant">0为全长1为鼠标模式下变体2为迷你3为仅图标</param> /// <param name="variant">0为全长1为鼠标模式下变体2为迷你3为仅HeadIcon图标</param>
private void UpdateToolBarVariant(int variant) { private void UpdateToolBarVariant(int variant) {
var _snapTypeTemp = SnapType;
ToolBarNowVariantMode = variant;
HideAllPopups();
IEnumerable<FloatingBarItem> items; IEnumerable<FloatingBarItem> items;
if (variant == 0) items = ToolbarItems.AsEnumerable(); if (variant == 0) items = ToolbarItems.AsEnumerable();
else if (variant == 1) else if (variant == 1)
items = ToolbarItems.Where((item, i) => (new string[] { items = ToolbarItems.Where((item, i) => (new string[] {
"Cursor", "Pen", "Clear", "SeparatorC", "Gesture", "Menu", "Fold" "Cursor", "Pen", "Clear", "SeparatorC", "Whiteboard", "Gesture", "Menu", "Fold"
}).Contains(item.Name)); }).Contains(item.Name));
else if (variant == 2) else if (variant == 2)
items = ToolbarItems.Where((item, i) => (new string[] { items = ToolbarItems.Where((item, i) => (new string[] {
"Cursor", "Pen", "Clear" "Cursor", "Pen", "Clear"
}).Contains(item.Name)); }).Contains(item.Name));
else throw new NotImplementedException(); else if (variant == 3)
items = ToolbarItems.Where((item, i) => item.Selected);
else return;
foreach (var fi in ToolbarItems) { foreach (var fi in ToolbarItems) {
fi.IsVisible = items.Contains(fi); fi.IsVisible = items.Contains(fi);
@ -235,6 +397,15 @@ namespace Ink_Canvas
CollectionViewSource.GetDefaultView(ToolbarItems).Refresh(); CollectionViewSource.GetDefaultView(ToolbarItems).Refresh();
ReMeasureToolBar(); ReMeasureToolBar();
if (_snapTypeTemp == ToolBarSnapType.RightSide) {
Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24;
} else if (_snapTypeTemp == ToolBarSnapType.RightTopCorner) {
Top = -24;
Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24;
} else if (_snapTypeTemp == ToolBarSnapType.RightBottomCorner) {
Top = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24;
Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24;
}
} }
private void UpdateToolBarSelectedTool(MainWindow.ICCToolsEnum type) { private void UpdateToolBarSelectedTool(MainWindow.ICCToolsEnum type) {
@ -263,14 +434,197 @@ namespace Ink_Canvas
private void ReMeasureToolBar() { private void ReMeasureToolBar() {
var barWidth = CaculateToolBarWindowWidth(ToolbarItems); var barWidth = CaculateToolBarWindowWidth(ToolbarItems);
ToolBarV2Grid.Width = barWidth; ToolBarV2Grid.Width = barWidth;
Width = barWidth + 6 * 2; // 6是工具栏和窗口的Margin Width = barWidth + 24 * 2; // 6是工具栏和窗口的Margin
Height = 48 + 6 * 2; // 48是工具栏高度 Height = 48 + 24 * 2; // 48是工具栏高度
var offset = ToolBarNowVariantMode == 3 ? 0 : 6;
var offsetCp = ToolBarNowVariantMode == 3 ? 0.5 : 6.5;
var path = GenerateSuperEllipsePathByContentWidth(barWidth + offset, 48);
ToolBarBackgroundBorder.Geometry = Geometry.Parse(path);
var cg = GenerateSuperEllipsePathClipGeometry(barWidth + offsetCp, 48);
BackgroundBorderDrawingGroup.ClipGeometry = Geometry.Parse(cg);
Top = Math.Max(Math.Min(Top,
System.Windows.SystemParameters.PrimaryScreenHeight-ActualHeight +24),-24);
Left = Math.Max(Math.Min(Left,
System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth +24),-24);
}
public int ToolBarNowVariantMode = -1;
private string GenerateSuperEllipsePathClipGeometry(double width, double renderingHeight) {
double acutalHeight = 119.33;
double renderingScalingFactor = acutalHeight / renderingHeight;
double actualFullWidth = width * renderingScalingFactor;
double actualCenterWidth = actualFullWidth - 119.34 < 0 ? 0 : actualFullWidth - 119.34;
var cg = $"M0,0 V120 H{Math.Round(actualFullWidth, 0)} V0 H0 Z";
return cg;
}
/// <summary>
/// 根据给定的渲染高度计算比例并根据实际内容宽度计算超椭圆圆角矩形的SVG路径
/// </summary>
/// <param name="width"></param>
/// <param name="renderingHeight"></param>
/// <returns></returns>
private string GenerateSuperEllipsePathByContentWidth(double width, double renderingHeight) {
double acutalHeight = 119.33;
double renderingScalingFactor = acutalHeight / renderingHeight;
double actualFullWidth = width * renderingScalingFactor;
double actualCenterWidth = actualFullWidth - 119.34 < 0 ? 0 : actualFullWidth - 119.34;
var sb = "M64.3285 "
+ "0.015625"
+ $"H{Math.Round(64.3395 + actualCenterWidth,3)}"
+ $"C{Math.Round(90.3185 + actualCenterWidth,3)} "
+ "0.015625 "
+ $"{Math.Round(99.3081 + actualCenterWidth, 3)} "
+ "0.015625 "
+ $"{Math.Round(108.103 + actualCenterWidth, 3)} "
+ "7.11388"
+ $"C{Math.Round(109.871 + actualCenterWidth, 3)} "
+ "8.54031 "
+ $"{Math.Round(111.481 + actualCenterWidth, 3)} "
+ "10.1509 "
+ $"{Math.Round(112.908 + actualCenterWidth, 3)} "
+ "11.9183"
+ $"C{Math.Round(120.006 + actualCenterWidth, 3)} "
+ "20.7134 "
+ $"{Math.Round(120.006 + actualCenterWidth, 3)} "
+ "33.7029 "
+ $"{Math.Round(120.006 + actualCenterWidth, 3)} "
+ "59.6819"
+ $"C{Math.Round(120.006 + actualCenterWidth, 3)} "
+ "85.661 "
+ $"{Math.Round(120.006 + actualCenterWidth, 3)} "
+ "98.6505 "
+ $"{Math.Round(112.908 + actualCenterWidth, 3)} "
+ "107.446"
+ $"C{Math.Round(111.481 + actualCenterWidth, 3)} "
+ "109.213 "
+ $"{Math.Round(109.871 + actualCenterWidth, 3)} "
+ "110.824 "
+ $"{Math.Round(108.103 + actualCenterWidth, 3)} "
+ "112.25"
+ $"C{Math.Round(99.3081 + actualCenterWidth, 3)} "
+ "119.348 "
+ $"{Math.Round(90.3185 + actualCenterWidth, 3)} "
+ "119.348 "
+ $"{Math.Round(64.3395 + actualCenterWidth, 3)} "
+ "119.348"
+ "H64.3285C38.3494 "
+ "119.348 "
+ "21.3599 "
+ "119.348 "
+ "12.5648 "
+ "112.25"
+ "C10.7973 "
+ "110.824 "
+ "9.1868 "
+ "109.213 "
+ "7.76037 "
+ "107.446"
+ "C0.662109 "
+ "98.6505 "
+ "0.662109 "
+ "85.661 "
+ "0.662109 "
+ "59.6819"
+ "C0.662109 "
+ "33.7029 "
+ "0.662109 "
+ "20.7134 "
+ "7.76037 "
+ "11.9183"
+ "C9.1868 "
+ "10.1509 "
+ "10.7973 "
+ "8.54031 "
+ "12.5648 "
+ "7.11388"
+ "C21.3599 "
+ "0.015625 "
+ "38.3494 "
+ "0.015625 "
+ "64.3285 "
+ "0.015625"
+ "Z";
return sb;
}
public enum ToolBarSnapType {
NoSnap,
LeftTopCorner,
RightTopCorner,
LeftBottomCorner,
RightBottomCorner,
RightSide,
LeftSide,
BottomSide,
TopSide
}
public ToolBarSnapType SnapType {
get {
if (Top <= -24 && Left <= -24) return ToolBarSnapType.LeftTopCorner;
if (Top >= System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24 && Left <= -24) return ToolBarSnapType.LeftBottomCorner;
if (Top <= -24 && Left >= System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24) return ToolBarSnapType.RightTopCorner;
if (Top >= System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24 &&
Left >= System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24) return ToolBarSnapType.RightBottomCorner;
if (Top <= -24) return ToolBarSnapType.TopSide;
if (Top >= System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24)
return ToolBarSnapType.BottomSide;
if (Left <= -24) return ToolBarSnapType.LeftSide;
if (Left >= System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24)
return ToolBarSnapType.RightSide;
return ToolBarSnapType.NoSnap;
}
} }
private void OnToolSelectionChanged(FloatingBarItem sender) { private void OnToolSelectionChanged(FloatingBarItem sender) {
if (sender.Selected && sender.ToolType != MainWindow.ICCToolsEnum.CursorMode) if (ToolBarNowVariantMode == 3) return;
UpdateToolBarVariant(0); HideAllPopups();
else UpdateToolBarVariant(1); if (sender.Selected && sender.ToolType != MainWindow.ICCToolsEnum.CursorMode) {
if (ToolBarNowVariantMode != 0) UpdateToolBarVariant(0);
} else {
if (ToolBarNowVariantMode != 1) UpdateToolBarVariant(1);
}
}
private void OnToolButtonClicked(FloatingBarItem sender, Grid container) {
if (sender.ToolType == MainWindow.ICCToolsEnum.PenMode) {
if (PenPaletteV2Popup.IsOpen) {
HideAllPopups();
} else {
var containerPoint = container.TranslatePoint(new Point(0, 0), ToolBarV2Grid);
PenPaletteV2Popup.HorizontalOffset = containerPoint.X;
if (System.Windows.SystemParameters.PrimaryScreenHeight - Top - Height + 24 > PenPaletteV2.Height) PenPaletteV2Popup.VerticalOffset = Height -24 ;
else PenPaletteV2Popup.VerticalOffset = 0 - PenPaletteV2.Height + 24;
PenPaletteV2Popup.IsOpen = true;
}
} else if (sender.ToolType == MainWindow.ICCToolsEnum.LassoMode) {
if (SelectionPopupV2.IsOpen) {
HideAllPopups();
} else {
var containerPoint = container.TranslatePoint(new Point(0, 0), ToolBarV2Grid);
SelectionPopupV2.HorizontalOffset = containerPoint.X;
if (System.Windows.SystemParameters.PrimaryScreenHeight - Top - Height + 24 > SelectionV2.Height) SelectionPopupV2.VerticalOffset = Height - 24 ;
else SelectionPopupV2.VerticalOffset = 0 - SelectionV2.Height + 24;
SelectionPopupV2.IsOpen = true;
}
} else if (sender.Name == "ShapeDrawing") {
if (ShapeDrawingPopupV2.IsOpen) {
HideAllPopups();
} else {
var containerPoint = container.TranslatePoint(new Point(0, 0), ToolBarV2Grid);
ShapeDrawingPopupV2.HorizontalOffset = containerPoint.X;
if (System.Windows.SystemParameters.PrimaryScreenHeight - Top - Height + 24 > ShapeDrawingV2.Height) ShapeDrawingPopupV2.VerticalOffset = Height - 24 ;
else ShapeDrawingPopupV2.VerticalOffset = 0 - ShapeDrawingV2.Height + 24;
ShapeDrawingPopupV2.IsOpen = true;
}
}
} }
private void ToolbarButton_MouseDown(object sender, MouseButtonEventArgs e) { private void ToolbarButton_MouseDown(object sender, MouseButtonEventArgs e) {
@ -282,6 +636,7 @@ namespace Ink_Canvas
var bgImg = gd.Children[1] as Image; var bgImg = gd.Children[1] as Image;
bgImg.Opacity = 1; bgImg.Opacity = 1;
} }
gd.RenderTransform = new ScaleTransform(0.9, 0.9);
} }
private void ToolbarButton_MouseUp(object sender, MouseButtonEventArgs e) { private void ToolbarButton_MouseUp(object sender, MouseButtonEventArgs e) {
@ -290,12 +645,88 @@ namespace Ink_Canvas
var gd = sender as Grid; var gd = sender as Grid;
var itemData = gd.Tag as FloatingBarItem; var itemData = gd.Tag as FloatingBarItem;
if (itemData.Type == FloatingBarItemType.StateButton) { if (itemData.Type == FloatingBarItemType.StateButton && !itemData.Selected) {
UpdateToolBarSelectedTool(itemData.ToolType); UpdateToolBarSelectedTool(itemData.ToolType);
OnToolSelectionChanged(itemData); OnToolSelectionChanged(itemData);
} else {
OnToolButtonClicked(itemData, gd);
} }
} }
public int DynamicTransparentVariant { get; set; } = 1;
/// <summary>
/// 根据提供的变体ID修改工具栏动态透明的变体类型
/// </summary>
/// <param name="variant">0为透明1为不透明</param>
private void UpdateToolBarDynamicOpacityVariant(int variant) {
DynamicTransparentVariant = variant;
if (variant == 0) {
FallbackBackgroundLayer.Opacity = 0.05;
ToolBarBackgroundBorder.Pen = new Pen() {
Brush = new SolidColorBrush(Color.FromArgb(48, 34, 34, 34)),
Thickness = 3,
};
ToolBarBackgroundBorder.Brush = new SolidColorBrush(Color.FromArgb(16, 255,255,255));
HeadIcon.Opacity = 0.5;
ToolBarItemsControl.Opacity = 0.92;
foreach (var fi in ToolbarItems) {
fi.IsSemiTransparent = true;
if (fi.Type == FloatingBarItemType.Separator) continue;
if (fi.IconSourceResourceKey == "") continue;
var icon = FindResource(fi.IconSourceResourceKey) as DrawingImage;
foreach (var gd in (icon.Drawing as DrawingGroup).Children) {
var _gd = gd as GeometryDrawing;
_gd.Pen = new Pen() {
Brush = new SolidColorBrush(Color.FromArgb(148, 34,34,34)),
Thickness = 1,
};
if (fi.IconColor != null)
_gd.Brush = new SolidColorBrush(Color.FromArgb(96, (byte)Math.Min(((Color)fi.IconColor).R * 4.25,255),
(byte)Math.Min(((Color)fi.IconColor).G * 4.25,255),(byte)Math.Min(((Color)fi.IconColor).B * 4.25,255)));
else _gd.Brush = new SolidColorBrush(Color.FromArgb(96, 255,255,255));
}
if (fi.Selected) {
var clonedIcon = icon.Clone();
foreach (var d in (clonedIcon.Drawing as DrawingGroup).Children)
((GeometryDrawing)d).Brush = new SolidColorBrush(Colors.White);
fi.IconSource = clonedIcon;
}
}
} else if (variant == 1) {
FallbackBackgroundLayer.Opacity = 1;
ToolBarBackgroundBorder.Pen = new Pen() {
Brush = new SolidColorBrush(Color.FromRgb(212,212,216)),
Thickness = 3,
};
ToolBarBackgroundBorder.Brush = new SolidColorBrush(Color.FromRgb(250, 250, 250));
HeadIcon.Opacity = 1;
ToolBarItemsControl.Opacity = 1;
foreach (var fi in ToolbarItems) {
fi.IsSemiTransparent = false;
if (fi.Type == FloatingBarItemType.Separator) continue;
if (fi.IconSourceResourceKey == "") continue;
var icon = FindResource(fi.IconSourceResourceKey) as DrawingImage;
foreach (var gd in (icon.Drawing as DrawingGroup).Children) {
var _gd = gd as GeometryDrawing;
_gd.Pen = null;
_gd.Brush = new SolidColorBrush(fi.IconColor??Color.FromRgb(34,34,34));
}
if (fi.Selected) {
var clonedIcon = icon.Clone();
foreach (var d in (clonedIcon.Drawing as DrawingGroup).Children)
((GeometryDrawing)d).Brush = new SolidColorBrush(Colors.White);
fi.IconSource = clonedIcon;
}
}
}
CollectionViewSource.GetDefaultView(ToolbarItems).Refresh();
ReMeasureToolBar();
}
[DllImport("USER32.DLL", SetLastError = true)] [DllImport("USER32.DLL", SetLastError = true)]
public static extern int GetSystemMetrics(int nIndex); public static extern int GetSystemMetrics(int nIndex);
@ -306,47 +737,100 @@ namespace Ink_Canvas
var bgImg = _mouseDownButton.Children[1] as Image; var bgImg = _mouseDownButton.Children[1] as Image;
bgImg.Opacity = 0; bgImg.Opacity = 0;
} }
_mouseDownButton.RenderTransform = null;
_mouseDownButton = null; _mouseDownButton = null;
} }
public Point prevPoint = new Point(0,0); public Point prevPoint = new Point(0,0);
public Point lastPoint = new Point(0, 0);
public bool isInMovingMode = false; public bool isInMovingMode = false;
public double winLeft = 0; public double winLeft = 0;
public double winTop = 0; public double winTop = 0;
public ToolBarSnapType _snapTypeTemp = ToolBarSnapType.NoSnap;
private void HeadIconButton_MouseDown(object sender, MouseButtonEventArgs e) { private void HeadIconButton_MouseDown(object sender, MouseButtonEventArgs e) {
if (_isMouseDownHeadIcon) return; if (_isMouseDownHeadIcon) return;
_isMouseDownHeadIcon = true; if (e.RightButton == MouseButtonState.Pressed) {
var gd = sender as Grid; UpdateToolBarDynamicOpacityVariant(Math.Abs(DynamicTransparentVariant-1));
prevPoint = e.GetPosition(ToolBarV2Grid); } else {
winLeft = Left; _isMouseDownHeadIcon = true;
winTop = Top; var gd = sender as Grid;
Trace.WriteLine(prevPoint); prevPoint = e.GetPosition(ToolBarV2Grid);
gd.CaptureMouse(); winLeft = Left;
gd.RenderTransform = new ScaleTransform(0.95, 0.95); winTop = Top;
isInMovingMode = false; Trace.WriteLine(prevPoint);
gd.CaptureMouse();
gd.RenderTransform = new ScaleTransform(0.92, 0.92);
isInMovingMode = false;
_snapTypeTemp = SnapType;
}
} }
private void HeadIconButton_MouseMove(object sender, MouseEventArgs e) { private void HeadIconButton_MouseMove(object sender, MouseEventArgs e) {
if (_isMouseDownHeadIcon == false) return; if (_isMouseDownHeadIcon == false) return;
var nowPt = e.GetPosition(ToolBarV2Grid); var mp = System.Windows.Forms.Control.MousePosition;
lastPoint = nowPt; var mpLogical = new Point(mp.X * ScalingFactor, mp.Y * ScalingFactor);
var deltaX = nowPt.X - prevPoint.X; var deltaX = mpLogical.X - prevPoint.X - winLeft - 24;
var deltaY = nowPt.Y - prevPoint.Y; var deltaY = mpLogical.Y - prevPoint.Y - winTop - 24;
if (Math.Abs(deltaY) > 16 || Math.Abs(deltaX) > 16) isInMovingMode = true; var movingLimitation = _snapTypeTemp == ToolBarSnapType.NoSnap ? 12 : 24;
if (Math.Abs(deltaY) > movingLimitation || Math.Abs(deltaX) > movingLimitation) isInMovingMode = true;
if (isInMovingMode) { if (isInMovingMode) {
HideAllPopups();
ToolbarV2.RenderTransform = null; ToolbarV2.RenderTransform = null;
ToolBarV2Grid.RenderTransform = null;
HeadIconImage.RenderTransform = null; HeadIconImage.RenderTransform = null;
var mp = System.Windows.Forms.Control.MousePosition; Top = Math.Max(Math.Min(mp.Y * ScalingFactor - prevPoint.Y - 24,
Top = mp.Y * ScalingFactor - prevPoint.Y - 6; System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight +24),-24);
Left = mp.X * ScalingFactor - prevPoint.X - 6; Left = Math.Max(Math.Min(mp.X * ScalingFactor - prevPoint.X - 24,
System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth +24),-24);
} else { } else {
ToolbarV2.RenderTransform = new TranslateTransform(deltaX / 3, deltaY / 3); double tbMovingX = deltaX/3, tbMovingY = deltaY/3;
HeadIconImage.RenderTransform = new TranslateTransform(deltaX / 8, deltaY / 8); if (_snapTypeTemp == ToolBarSnapType.LeftSide) {
tbMovingX = Math.Max(deltaX / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0.5);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1);
} else if (_snapTypeTemp == ToolBarSnapType.RightSide) {
tbMovingX = Math.Min(deltaX / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0.5);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1);
} else if (_snapTypeTemp == ToolBarSnapType.TopSide) {
tbMovingY = Math.Max(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 0);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 + tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.BottomSide) {
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 - tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.LeftTopCorner) {
tbMovingX = Math.Max(deltaX / 3, 0);
tbMovingY = Math.Max(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 + tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.LeftBottomCorner) {
tbMovingX = Math.Max(deltaX / 3, 0);
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 - tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.RightTopCorner) {
tbMovingX = Math.Min(deltaX / 3, 0);
tbMovingY = Math.Max(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 + tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.RightBottomCorner) {
tbMovingX = Math.Min(deltaX / 3, 0);
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 - tbMovingY /120);
}
ToolbarV2.RenderTransform = new TranslateTransform(tbMovingX, tbMovingY);
HeadIconImage.RenderTransform = new TranslateTransform(tbMovingX / 2, tbMovingY / 2);
} }
} }
public FloatingBarItem SelectedItem {
get => ToolbarItems.Single(item => item.Selected);
}
private void HeadIconButton_MouseUp(object sender, MouseButtonEventArgs e) { private void HeadIconButton_MouseUp(object sender, MouseButtonEventArgs e) {
if (_isMouseDownHeadIcon == false) return; if (_isMouseDownHeadIcon == false) return;
_isMouseDownHeadIcon = false; _isMouseDownHeadIcon = false;
@ -354,7 +838,21 @@ namespace Ink_Canvas
gd.ReleaseMouseCapture(); gd.ReleaseMouseCapture();
gd.RenderTransform = null; gd.RenderTransform = null;
ToolbarV2.RenderTransform = null; ToolbarV2.RenderTransform = null;
ToolBarV2Grid.RenderTransform = null;
HeadIconImage.RenderTransform = null; HeadIconImage.RenderTransform = null;
if (!isInMovingMode) {
var mp = System.Windows.Forms.Control.MousePosition;
var mpLogical = new Point(mp.X * ScalingFactor, mp.Y * ScalingFactor);
if (Math.Abs(mpLogical.X - prevPoint.X - winLeft - 24) < 4 || Math.Abs(mpLogical.Y - prevPoint.Y - winTop - 24) < 4) {
if (ToolBarNowVariantMode == 3) {
if (SelectedItem.ToolType != MainWindow.ICCToolsEnum.CursorMode)
UpdateToolBarVariant(0);
else UpdateToolBarVariant(1);
} else {
UpdateToolBarVariant(3);
}
}
}
isInMovingMode = false; isInMovingMode = false;
} }
} }

View File

@ -381,6 +381,7 @@ namespace Ink_Canvas.Windows {
var _thumb = thumb as Border; var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(4); _thumb.CornerRadius = new CornerRadius(4);
_thumb.Width = 8; _thumb.Width = 8;
_thumb.Margin = new Thickness(-0.75, 0, 1, 0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(138, 138, 138)); _thumb.Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
} }
} }
@ -406,6 +407,7 @@ namespace Ink_Canvas.Windows {
var _thumb = thumb as Border; var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(1.5); _thumb.CornerRadius = new CornerRadius(1.5);
_thumb.Width = 3; _thumb.Width = 3;
_thumb.Margin = new Thickness(0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(195, 195, 195)); _thumb.Background = new SolidColorBrush(Color.FromRgb(195, 195, 195));
} }
} }