mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Device properties - Implemented LED mappings tab
Device properties - Tweak design
This commit is contained in:
1 parent
78479c0fa2
commit
a06bc68046
21 files changed
+295
-129
No files matched your search
+3
-4
@@ -6,8 +6,7 @@
|
||||
xmlns:timeline="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes.TimelineKeyframeView"
|
||||
ClipToBounds="False"
|
||||
Height="{DynamicResource RailsHeight}">
|
||||
ClipToBounds="False">
|
||||
<Ellipse Fill="{DynamicResource SystemAccentColorLight2}"
|
||||
Stroke="White"
|
||||
Width="10"
|
||||
@@ -52,7 +51,7 @@
|
||||
<avalonia:MaterialIcon Kind="Creation" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="-" />
|
||||
<MenuItem Header="Duplicate" Command="{Binding $parent[timeline:TimelineView].DataContext.DuplicateKeyframes}" CommandParameter="{Binding}" InputGesture="Ctrl+D">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="ContentDuplicate" />
|
||||
@@ -68,7 +67,7 @@
|
||||
<avalonia:MaterialIcon Kind="ContentPaste" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="-" />
|
||||
<MenuItem Header="Delete" Command="{Binding $parent[timeline:TimelineView].DataContext.DeleteKeyframes}" CommandParameter="{Binding}" InputGesture="Delete">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="Delete" />
|
||||
|
||||
+4
-3
@@ -9,7 +9,7 @@
|
||||
x:DataType="timeline:TimelineGroupViewModel">
|
||||
<Grid RowDefinitions="28,1,Auto">
|
||||
<ItemsControl Grid.Row="0"
|
||||
Height="{DynamicResource RailsHeight}"
|
||||
Height="28"
|
||||
IsVisible="{CompiledBinding !PropertyGroupViewModel.IsExpanded}"
|
||||
Items="{CompiledBinding KeyframePositions}"
|
||||
HorizontalAlignment="Stretch">
|
||||
@@ -21,16 +21,17 @@
|
||||
<ItemsControl.Styles>
|
||||
<Style Selector="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding}" />
|
||||
<Setter Property="Canvas.Top" Value="9" />
|
||||
</Style>
|
||||
</ItemsControl.Styles>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Ellipse Fill="{DynamicResource ControlFillColorDisabledBrush}"
|
||||
<Ellipse Fill="{DynamicResource ControlSolidFillColorDefaultBrush}"
|
||||
Stroke="White"
|
||||
StrokeThickness="0"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="-5,6,0,0" />
|
||||
Margin="-5 0 0 0" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
+8
-8
@@ -11,7 +11,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
|
||||
public class TimelineGroupViewModel : ActivatableViewModelBase
|
||||
{
|
||||
private ObservableCollection<double>? _keyframePositions;
|
||||
private int _pixelsPerSecond;
|
||||
private ObservableAsPropertyHelper<int>? _pixelsPerSecond;
|
||||
|
||||
public TimelineGroupViewModel(PropertyGroupViewModel propertyGroupViewModel, IProfileEditorService profileEditorService)
|
||||
{
|
||||
@@ -19,16 +19,16 @@ public class TimelineGroupViewModel : ActivatableViewModelBase
|
||||
|
||||
this.WhenActivated(d =>
|
||||
{
|
||||
profileEditorService.PixelsPerSecond.Subscribe(p =>
|
||||
{
|
||||
_pixelsPerSecond = p;
|
||||
UpdateKeyframePositions();
|
||||
}).DisposeWith(d);
|
||||
this.WhenAnyValue(vm => vm.PropertyGroupViewModel.IsExpanded).Subscribe(_ => UpdateKeyframePositions()).DisposeWith(d);
|
||||
_pixelsPerSecond = profileEditorService.PixelsPerSecond.ToProperty(this, vm => vm.PixelsPerSecond).DisposeWith(d);
|
||||
profileEditorService.PixelsPerSecond.Subscribe(p => UpdateKeyframePositions()).DisposeWith(d);
|
||||
PropertyGroupViewModel.WhenAnyValue(vm => vm.IsExpanded).Subscribe(_ => this.RaisePropertyChanged(nameof(Children))).DisposeWith(d);
|
||||
PropertyGroupViewModel.WhenAnyValue(vm => vm.IsExpanded).Subscribe(_ => UpdateKeyframePositions()).DisposeWith(d);
|
||||
this.WhenAnyValue(vm => vm.PixelsPerSecond).Subscribe(_ => UpdateKeyframePositions()).DisposeWith(d);
|
||||
UpdateKeyframePositions();
|
||||
});
|
||||
}
|
||||
|
||||
public int PixelsPerSecond => _pixelsPerSecond?.Value ?? 0;
|
||||
public PropertyGroupViewModel PropertyGroupViewModel { get; }
|
||||
|
||||
public ObservableCollection<ViewModelBase>? Children => PropertyGroupViewModel.IsExpanded ? PropertyGroupViewModel.Children : null;
|
||||
@@ -43,6 +43,6 @@ public class TimelineGroupViewModel : ActivatableViewModelBase
|
||||
{
|
||||
KeyframePositions = new ObservableCollection<double>(PropertyGroupViewModel
|
||||
.GetAllKeyframeViewModels(false)
|
||||
.Select(p => p.Position.TotalSeconds * _pixelsPerSecond));
|
||||
.Select(p => p.Position.TotalSeconds * PixelsPerSecond));
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -4,7 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelinePropertyView">
|
||||
<Border Height="{DynamicResource RailsBorderHeight}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource ButtonBorderBrush}">
|
||||
<Border Height="29" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource ButtonBorderBrush}">
|
||||
<ItemsControl Items="{Binding KeyframeViewModels}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@@ -14,6 +14,7 @@
|
||||
<ItemsControl.Styles>
|
||||
<Style Selector="ItemsControl > ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding X, TargetNullValue=0}" />
|
||||
<Setter Property="Canvas.Top" Value="9" />
|
||||
</Style>
|
||||
</ItemsControl.Styles>
|
||||
</ItemsControl>
|
||||
|
||||
Reference in new issue
Block a user