Merge branch 'development' into feature/workshop

This commit is contained in:
Robert committed 2023-08-09 11:58:37 +02:00
commit c6a318b6e3
10 files changed
+25 -40

No files matched your search

@@ -111,7 +111,6 @@ public class PropertiesViewModel : ActivatableViewModelBase
}
public RenderProfileElement? ProfileElement => _profileElement?.Value;
public Layer? Layer => _profileElement?.Value as Layer;
public ILayerProperty? LayerProperty => _layerProperty?.Value;
public bool SuspendedEditing => _suspendedEditing?.Value ?? false;
@@ -133,26 +132,27 @@ public class PropertiesViewModel : ActivatableViewModelBase
private void UpdatePropertyGroups()
{
if (ProfileElement == null)
RenderProfileElement? profileElement = ProfileElement;
if (profileElement == null)
{
PropertyGroupViewModels.Clear();
return;
}
ObservableCollection<PropertyGroupViewModel> viewModels = new();
if (Layer != null)
if (profileElement is Layer layer)
{
// Add base VMs
viewModels.Add(GetOrCreatePropertyViewModel(Layer.General, null, null));
viewModels.Add(GetOrCreatePropertyViewModel(Layer.Transform, null, null));
viewModels.Add(GetOrCreatePropertyViewModel(layer.General, null, null));
viewModels.Add(GetOrCreatePropertyViewModel(layer.Transform, null, null));
// Add brush VM if the brush has properties
if (Layer.LayerBrush?.BaseProperties != null)
viewModels.Add(GetOrCreatePropertyViewModel(Layer.LayerBrush.BaseProperties, Layer.LayerBrush, null));
if (layer.LayerBrush?.BaseProperties != null)
viewModels.Add(GetOrCreatePropertyViewModel(layer.LayerBrush.BaseProperties, layer.LayerBrush, null));
}
// Add effect VMs
foreach (BaseLayerEffect layerEffect in ProfileElement.LayerEffects.OrderBy(e => e.Order))
foreach (BaseLayerEffect layerEffect in profileElement.LayerEffects.OrderBy(e => e.Order))
{
if (layerEffect.BaseProperties != null)
viewModels.Add(GetOrCreatePropertyViewModel(layerEffect.BaseProperties, null, layerEffect));
@@ -45,7 +45,7 @@
</Grid>
<Border Classes="card-separator" />
<Grid RowDefinitions="*,*" ColumnDefinitions="*,Auto">
<Grid RowDefinitions="*,*" ColumnDefinitions="*,Auto" IsVisible="{CompiledBinding IsWindows11}">
<StackPanel Grid.Column="0">
<TextBlock>Enable Mica effect</TextBlock>
<TextBlock Classes="subtitle" TextWrapping="Wrap">
@@ -56,7 +56,7 @@
<ToggleSwitch IsChecked="{CompiledBinding EnableMica.Value}" OnContent="Yes" OffContent="No" MinWidth="0" Margin="0 -10" />
</StackPanel>
</Grid>
<Border Classes="card-separator" />
<Border Classes="card-separator" IsVisible="{CompiledBinding IsWindows11}"/>
<Grid RowDefinitions="*,*" ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0">
@@ -20,6 +20,7 @@ using Artemis.UI.Shared.Services.Builders;
using Avalonia.Threading;
using DryIoc;
using DynamicData;
using FluentAvalonia.Interop;
using ReactiveUI;
using Serilog.Events;
@@ -95,6 +96,7 @@ public class GeneralTabViewModel : ActivatableViewModelBase
public ReactiveCommand<Unit, Unit> ShowDataFolder { get; }
public bool IsAutoRunSupported => _autoRunProvider != null;
public bool IsWindows11 => OSVersionHelper.IsWindows11();
public ObservableCollection<LayerBrushDescriptor> LayerBrushDescriptors { get; }
public ObservableCollection<string> GraphicsContexts { get; }
@@ -39,11 +39,13 @@ public class SidebarViewModel : ActivatableViewModelBase
SidebarScreen = new SidebarScreenViewModel(MaterialIconKind.Abacus, ROOT_SCREEN, "", null, new ObservableCollection<SidebarScreenViewModel>()
{
new(MaterialIconKind.HomeOutline, "Home", "home"),
#if DEBUG
new(MaterialIconKind.TestTube, "Workshop", "workshop", null, new ObservableCollection<SidebarScreenViewModel>
{
new(MaterialIconKind.FolderVideo, "Profiles", "workshop/profiles/1", "workshop/profiles"),
new(MaterialIconKind.KeyboardVariant, "Layouts", "workshop/layouts/1", "workshop/layouts"),
}),
#endif
new(MaterialIconKind.Devices, "Surface Editor", "surface-editor"),
new(MaterialIconKind.SettingsOutline, "Settings", "settings")
});