|
@@ -223,10 +223,11 @@ internal class ToolsViewModel : SubViewModel<ViewModelMain>, IToolsHandler
|
|
|
|
|
|
if (ActiveTool != null)
|
|
if (ActiveTool != null)
|
|
{
|
|
{
|
|
- ActiveTool.OnDeselecting();
|
|
|
|
|
|
+ ActiveTool.OnDeselecting(transient);
|
|
ActiveTool.Toolbar.SettingChanged -= ToolbarSettingChanged;
|
|
ActiveTool.Toolbar.SettingChanged -= ToolbarSettingChanged;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ bool wasTransient = ActiveTool?.IsTransient ?? false;
|
|
if (ActiveTool != null) ActiveTool.IsTransient = false;
|
|
if (ActiveTool != null) ActiveTool.IsTransient = false;
|
|
bool shareToolbar = EnableSharedToolbar;
|
|
bool shareToolbar = EnableSharedToolbar;
|
|
if (ActiveTool is not null)
|
|
if (ActiveTool is not null)
|
|
@@ -247,13 +248,15 @@ internal class ToolsViewModel : SubViewModel<ViewModelMain>, IToolsHandler
|
|
}
|
|
}
|
|
|
|
|
|
if (LastActionTool != ActiveTool)
|
|
if (LastActionTool != ActiveTool)
|
|
|
|
+ {
|
|
SelectedToolChanged?.Invoke(this, new SelectedToolEventArgs(LastActionTool, ActiveTool));
|
|
SelectedToolChanged?.Invoke(this, new SelectedToolEventArgs(LastActionTool, ActiveTool));
|
|
|
|
+ }
|
|
|
|
|
|
//update old tool
|
|
//update old tool
|
|
LastActionTool?.ModifierKeyChanged(false, false, false);
|
|
LastActionTool?.ModifierKeyChanged(false, false, false);
|
|
//update new tool
|
|
//update new tool
|
|
ActiveTool.ModifierKeyChanged(ctrlIsDown, shiftIsDown, altIsDown);
|
|
ActiveTool.ModifierKeyChanged(ctrlIsDown, shiftIsDown, altIsDown);
|
|
- ActiveTool.OnSelected();
|
|
|
|
|
|
+ ActiveTool.OnSelected(wasTransient);
|
|
|
|
|
|
tool.IsActive = true;
|
|
tool.IsActive = true;
|
|
ActiveTool.IsTransient = transient;
|
|
ActiveTool.IsTransient = transient;
|