Editor - Fixed suspending layers

Editor - Disable suspending layers with spacebar
Nodes - Fixed changed event source node not using numerics
Nodes - Simplify checking wether a pin is numeric
This commit is contained in:
Robert committed 2022-07-31 17:17:37 +02:00
1 parent eec2419005
commit 5c4175ed9c
16 files changed
+55 -36

No files matched your search

@@ -44,7 +44,7 @@ public class DisplayConditionScriptViewModel : ActivatableViewModelBase
.DisposeWith(d);
});
_conditionViewModel = this.WhenAnyValue(vm => vm.SelectedConditionTypeViewModel).Select(_ => CreateConditionViewModel()).ToProperty(this, vm => vm.ConditionViewModel);
_conditionViewModel = this.WhenAnyValue(vm => vm.SelectedConditionTypeViewModel, vm => vm.ProfileElement).Select(_ => CreateConditionViewModel()).ToProperty(this, vm => vm.ConditionViewModel);
}
public RenderProfileElement? ProfileElement => _profileElement?.Value;
@@ -40,6 +40,7 @@
Classes="icon-button icon-button-small"
ToolTip.Tip="Toggle suspended state"
IsChecked="{CompiledBinding Folder.Suspended}"
Focusable="False"
VerticalAlignment="Center"
Margin="4 0">
<avalonia:MaterialIcon Kind="Pause" />
@@ -31,6 +31,7 @@
Classes="icon-button icon-button-small"
ToolTip.Tip="Toggle suspended state"
IsChecked="{CompiledBinding Layer.Suspended}"
Focusable="False"
VerticalAlignment="Center"
Margin="4 0">
<avalonia:MaterialIcon Kind="Pause" />
@@ -31,6 +31,7 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
private ProfileElement? _profileElement;
private string? _renameValue;
private bool _renaming;
private TimeSpan _time;
protected TreeItemViewModel(TreeItemViewModel? parent,
ProfileElement? profileElement,
@@ -56,6 +57,7 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
this.WhenActivated(d =>
{
ProfileEditorService.Time.Subscribe(t => _time = t).DisposeWith(d);
ProfileEditorService.ProfileElement.Subscribe(element => _currentProfileElement = element).DisposeWith(d);
SubscribeToProfileElement(d);
CreateTreeItems();
@@ -173,6 +175,7 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
Observable.FromEventPattern<ProfileElementEventArgs>(x => ProfileElement.ChildRemoved += x, x => ProfileElement.ChildRemoved -= x)
.Subscribe(c => RemoveTreeItemsIfFound(c.Sender, c.EventArgs.ProfileElement))
.DisposeWith(d);
ProfileElement.WhenAnyValue(e => e.Suspended).Subscribe(_ => ProfileEditorService.ChangeTime(_time)).DisposeWith(d);
}
protected void RemoveTreeItemsIfFound(object? sender, ProfileElement profileElement)