|
@@ -74,13 +74,13 @@ internal class IoViewModel : SubViewModel<ViewModelMain>
|
|
{
|
|
{
|
|
window.KeyDown += MainWindowKeyDown;
|
|
window.KeyDown += MainWindowKeyDown;
|
|
window.KeyUp += MainWindowKeyUp;
|
|
window.KeyUp += MainWindowKeyUp;
|
|
-
|
|
|
|
|
|
+
|
|
window.Deactivated += keyboardFilter.DeactivatedInlet;
|
|
window.Deactivated += keyboardFilter.DeactivatedInlet;
|
|
window.Deactivated += mouseFilter.DeactivatedInlet;
|
|
window.Deactivated += mouseFilter.DeactivatedInlet;
|
|
-
|
|
|
|
|
|
+
|
|
window.Closing += HostWindowOnClosing;
|
|
window.Closing += HostWindowOnClosing;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void HostWindowOnClosing(object? sender, WindowClosingEventArgs e)
|
|
private void HostWindowOnClosing(object? sender, WindowClosingEventArgs e)
|
|
{
|
|
{
|
|
if (sender is not HostWindow hostWindow)
|
|
if (sender is not HostWindow hostWindow)
|
|
@@ -301,13 +301,28 @@ internal class IoViewModel : SubViewModel<ViewModelMain>
|
|
}
|
|
}
|
|
):
|
|
):
|
|
|
|
|
|
- Owner.ColorsSubViewModel.SwapColors(null);
|
|
|
|
|
|
+ if (!Owner.DocumentManagerSubViewModel.ActiveDocument.UpdateableChangeActive)
|
|
|
|
+ {
|
|
|
|
+ Owner.ColorsSubViewModel.SwapColors(null);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ Owner.DocumentManagerSubViewModel.ActiveDocument.FinishedChange +=
|
|
|
|
+ FinishedChange;
|
|
|
|
+ }
|
|
|
|
+
|
|
break;
|
|
break;
|
|
case MouseButton.Right when tools.RightClickMode == RightClickMode.Erase:
|
|
case MouseButton.Right when tools.RightClickMode == RightClickMode.Erase:
|
|
HandleRightMouseEraseUp(tools);
|
|
HandleRightMouseEraseUp(tools);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void FinishedChange()
|
|
|
|
+ {
|
|
|
|
+ Owner.ColorsSubViewModel.SwapColors(null);
|
|
|
|
+ Owner.DocumentManagerSubViewModel.ActiveDocument.FinishedChange -= FinishedChange;
|
|
|
|
+ }
|
|
|
|
|
|
private void HandleRightMouseEraseUp(IToolsHandler tools)
|
|
private void HandleRightMouseEraseUp(IToolsHandler tools)
|
|
{
|
|
{
|