mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Nuget - Updated packages
Brush properties - Added default values Brush properties - Removed option to always auto-expand groups Layer properties - Remember expanded/collapsed groups Storage - Added migration system Storage - Added migration that removes profiles made in the old layer properties format Layer timeline - Added back zoom functionality
This commit is contained in:
1 parent
8456817a2b
commit
e6080eb897
58 files changed
+329
-188
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Abstract
|
||||
Children = new List<LayerPropertyBaseViewModel>();
|
||||
}
|
||||
|
||||
public bool IsExpanded { get; set; }
|
||||
public virtual bool IsExpanded { get; set; }
|
||||
public abstract bool IsVisible { get; }
|
||||
|
||||
public List<LayerPropertyBaseViewModel> Children { get; set; }
|
||||
|
||||
+2
-3
@@ -160,7 +160,7 @@
|
||||
<!-- Time -->
|
||||
<timeline:PropertyTimelineHeader Margin="0 25 0 0"
|
||||
Fill="{DynamicResource MaterialDesignBody}"
|
||||
PixelsPerSecond="{Binding PixelsPerSecond}"
|
||||
PixelsPerSecond="{Binding ProfileEditorService.PixelsPerSecond}"
|
||||
HorizontalOffset="{Binding ContentHorizontalOffset, ElementName=TimelineHeaderScrollViewer}"
|
||||
VisibleWidth="{Binding ActualWidth, ElementName=TimelineHeaderScrollViewer}"
|
||||
Width="{Binding ActualWidth, ElementName=PropertyTimeLine}" />
|
||||
@@ -198,13 +198,12 @@
|
||||
Background="{DynamicResource MaterialDesignCardBackground}">
|
||||
<!-- Zoom control -->
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding PixelsPerSecond}" VerticalAlignment="Center" />
|
||||
<Slider Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="10"
|
||||
Minimum="31"
|
||||
Maximum="350"
|
||||
Value="{Binding PixelsPerSecond}"
|
||||
Value="{Binding ProfileEditorService.PixelsPerSecond}"
|
||||
Width="319" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
+7
@@ -54,6 +54,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
|
||||
ProfileEditorService.ProfileElementSelected += ProfileEditorServiceOnProfileElementSelected;
|
||||
ProfileEditorService.CurrentTimeChanged += ProfileEditorServiceOnCurrentTimeChanged;
|
||||
ProfileEditorService.PixelsPerSecondChanged += ProfileEditorServiceOnPixelsPerSecondChanged;
|
||||
|
||||
base.OnInitialActivate();
|
||||
}
|
||||
@@ -62,6 +63,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
{
|
||||
ProfileEditorService.ProfileElementSelected -= ProfileEditorServiceOnProfileElementSelected;
|
||||
ProfileEditorService.CurrentTimeChanged -= ProfileEditorServiceOnCurrentTimeChanged;
|
||||
ProfileEditorService.PixelsPerSecondChanged -= ProfileEditorServiceOnPixelsPerSecondChanged;
|
||||
|
||||
base.OnClose();
|
||||
}
|
||||
@@ -83,6 +85,11 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
NotifyOfPropertyChange(() => TimeCaretPosition);
|
||||
}
|
||||
|
||||
private void ProfileEditorServiceOnPixelsPerSecondChanged(object? sender, EventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(nameof(TimeCaretPosition));
|
||||
}
|
||||
|
||||
#region View model managament
|
||||
|
||||
private void PopulateProperties(ProfileElement profileElement)
|
||||
|
||||
+6
-1
@@ -18,7 +18,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
|
||||
LayerPropertyGroup = layerPropertyGroup;
|
||||
PropertyGroupDescription = propertyGroupDescription;
|
||||
IsExpanded = PropertyGroupDescription.ExpandByDefault;
|
||||
|
||||
TreePropertyGroupViewModel = new TreePropertyGroupViewModel(this);
|
||||
TimelinePropertyGroupViewModel = new TimelinePropertyGroupViewModel(this);
|
||||
@@ -26,6 +25,12 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
||||
PopulateChildren();
|
||||
}
|
||||
|
||||
public override bool IsExpanded
|
||||
{
|
||||
get => LayerPropertyGroup.Layer.IsPropertyGroupExpanded(LayerPropertyGroup);
|
||||
set => LayerPropertyGroup.Layer.SetPropertyGroupExpanded(LayerPropertyGroup, value);
|
||||
}
|
||||
|
||||
public override bool IsVisible => !LayerPropertyGroup.IsHidden;
|
||||
|
||||
public IProfileEditorService ProfileEditorService { get; }
|
||||
|
||||
+8
@@ -19,6 +19,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline
|
||||
LayerPropertyViewModel.LayerProperty.KeyframeAdded += LayerPropertyOnKeyframeModified;
|
||||
LayerPropertyViewModel.LayerProperty.KeyframeRemoved += LayerPropertyOnKeyframeModified;
|
||||
LayerPropertyViewModel.LayerProperty.KeyframesToggled += LayerPropertyOnKeyframeModified;
|
||||
_profileEditorService.PixelsPerSecondChanged += ProfileEditorServiceOnPixelsPerSecondChanged;
|
||||
}
|
||||
|
||||
private void LayerPropertyOnKeyframeModified(object sender, EventArgs e)
|
||||
@@ -26,6 +27,12 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline
|
||||
UpdateKeyframes();
|
||||
}
|
||||
|
||||
private void ProfileEditorServiceOnPixelsPerSecondChanged(object? sender, EventArgs e)
|
||||
{
|
||||
foreach (var timelineKeyframeViewModel in TimelineKeyframeViewModels)
|
||||
timelineKeyframeViewModel.Update(_profileEditorService.PixelsPerSecond);
|
||||
}
|
||||
|
||||
public LayerPropertyViewModel<T> LayerPropertyViewModel { get; }
|
||||
|
||||
public override void UpdateKeyframes()
|
||||
@@ -55,6 +62,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
_profileEditorService.PixelsPerSecondChanged -= ProfileEditorServiceOnPixelsPerSecondChanged;
|
||||
LayerPropertyViewModel.LayerProperty.KeyframeAdded -= LayerPropertyOnKeyframeModified;
|
||||
LayerPropertyViewModel.LayerProperty.KeyframeRemoved -= LayerPropertyOnKeyframeModified;
|
||||
LayerPropertyViewModel.LayerProperty.KeyframesToggled -= LayerPropertyOnKeyframeModified;
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<TreeView ItemsSource="{Binding LayerPropertyGroups}"
|
||||
VirtualizingStackPanel.IsVirtualizing="True"
|
||||
VirtualizingStackPanel.VirtualizationMode="Recycling"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="{DynamicResource MaterialDesignToolBarBackground}"
|
||||
PreviewMouseWheel="{s:Action PropertyTreePreviewMouseWheel}"
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Width="{Binding Device.RgbDevice.ActualSize.Width}" Height="{Binding Device.RgbDevice.ActualSize.Height}">
|
||||
<Grid.LayoutTransform>
|
||||
<Grid.RenderTransform>
|
||||
<RotateTransform Angle="{Binding Device.Rotation}" />
|
||||
</Grid.LayoutTransform>
|
||||
</Grid.RenderTransform>
|
||||
|
||||
<!-- Device image with fallback -->
|
||||
<Image VerticalAlignment="Stretch"
|
||||
|
||||
Reference in new issue
Block a user