mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Folders - When display mode set to finish, finish all child timelines
Data bindings - Fixed an exception on profile editor undo Timeline - Added segment options dialog where you can enter a time
This commit is contained in:
1 parent
9f951ca33f
commit
bfc93778a6
18 files changed
+369
-102
No files matched your search
@@ -35,7 +35,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AvalonEdit" Version="6.0.1" />
|
||||
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
|
||||
<PackageReference Include="MaterialDesignExtensions" Version="3.1.0" />
|
||||
<PackageReference Include="MaterialDesignExtensions" Version="3.2.0" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||
<PackageReference Include="Ninject" Version="3.3.4" />
|
||||
|
||||
@@ -40,10 +40,9 @@
|
||||
</Border.Background>
|
||||
</Border>
|
||||
</Border>
|
||||
<Track
|
||||
x:Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
OpacityMask="{x:Null}">
|
||||
<Track x:Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
OpacityMask="{x:Null}">
|
||||
<Track.DecreaseRepeatButton>
|
||||
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{DynamicResource MaterialDesignHorizontalColorSliderTrackRepeatButton}" />
|
||||
</Track.DecreaseRepeatButton>
|
||||
@@ -101,13 +100,19 @@
|
||||
<RowDefinition Height="160" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<materialDesign:ColorPicker Grid.Row="0" Color="{Binding Color, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" MouseUp="ColorGradient_OnMouseUp" />
|
||||
<materialDesign:ColorPicker Grid.Row="0"
|
||||
Color="{Binding Color, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
MouseUp="ColorGradient_OnMouseUp"
|
||||
PreviewMouseDown="Slider_OnMouseDown"
|
||||
PreviewMouseUp="Slider_OnMouseUp"/>
|
||||
<Slider Grid.Row="1" Margin="8"
|
||||
IsMoveToPointEnabled="True"
|
||||
Orientation="Horizontal"
|
||||
Style="{DynamicResource MaterialDesignColorSlider}"
|
||||
Template="{StaticResource MaterialDesignOpacitySlider}"
|
||||
Value="{Binding ColorOpacity, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
PreviewMouseDown="Slider_OnMouseDown"
|
||||
PreviewMouseUp="Slider_OnMouseUp"
|
||||
Maximum="255" />
|
||||
</Grid>
|
||||
</materialDesign:Card>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -134,10 +135,38 @@ namespace Artemis.UI.Shared
|
||||
PopupOpen = !PopupOpen;
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void ColorGradient_OnMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void Slider_OnMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
OnDragStarted();
|
||||
}
|
||||
|
||||
private void Slider_OnMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
OnDragEnded();
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler DragStarted;
|
||||
public event EventHandler DragEnded;
|
||||
|
||||
protected virtual void OnDragStarted()
|
||||
{
|
||||
DragStarted?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnDragEnded()
|
||||
{
|
||||
DragEnded?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -154,23 +154,7 @@ namespace Artemis.UI.Shared.Services
|
||||
if (!undid)
|
||||
return false;
|
||||
|
||||
if (SelectedProfileElement is Folder folder)
|
||||
SelectedProfileElement = SelectedProfile.GetAllFolders().FirstOrDefault(f => f.EntityId == folder.EntityId);
|
||||
else if (SelectedProfileElement is Layer layer)
|
||||
SelectedProfileElement = SelectedProfile.GetAllLayers().FirstOrDefault(l => l.EntityId == layer.EntityId);
|
||||
|
||||
OnSelectedProfileChanged(new ProfileEventArgs(SelectedProfile, SelectedProfile));
|
||||
OnSelectedProfileElementChanged(new RenderProfileElementEventArgs(SelectedProfileElement));
|
||||
|
||||
if (SelectedProfileElement != null)
|
||||
{
|
||||
var elements = SelectedProfile.GetAllLayers().Cast<RenderProfileElement>().ToList();
|
||||
elements.AddRange(SelectedProfile.GetAllFolders());
|
||||
var element = elements.FirstOrDefault(l => l.EntityId == SelectedProfileElement.EntityId);
|
||||
ChangeSelectedProfileElement(element);
|
||||
}
|
||||
|
||||
UpdateProfilePreview();
|
||||
ReloadProfile();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -180,17 +164,7 @@ namespace Artemis.UI.Shared.Services
|
||||
if (!redid)
|
||||
return false;
|
||||
|
||||
OnSelectedProfileChanged(new ProfileEventArgs(SelectedProfile, SelectedProfile));
|
||||
|
||||
if (SelectedProfileElement != null)
|
||||
{
|
||||
var elements = SelectedProfile.GetAllLayers().Cast<RenderProfileElement>().ToList();
|
||||
elements.AddRange(SelectedProfile.GetAllFolders());
|
||||
var element = elements.FirstOrDefault(l => l.EntityId == SelectedProfileElement.EntityId);
|
||||
ChangeSelectedProfileElement(element);
|
||||
}
|
||||
|
||||
UpdateProfilePreview();
|
||||
ReloadProfile();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -307,6 +281,27 @@ namespace Artemis.UI.Shared.Services
|
||||
return SelectedProfile?.Module;
|
||||
}
|
||||
|
||||
private void ReloadProfile()
|
||||
{
|
||||
// Trigger a profile change
|
||||
OnSelectedProfileChanged(new ProfileEventArgs(SelectedProfile, SelectedProfile));
|
||||
// Trigger a selected element change
|
||||
var previousSelectedProfileElement = SelectedProfileElement;
|
||||
if (SelectedProfileElement is Folder folder)
|
||||
SelectedProfileElement = SelectedProfile.GetAllFolders().FirstOrDefault(f => f.EntityId == folder.EntityId);
|
||||
else if (SelectedProfileElement is Layer layer)
|
||||
SelectedProfileElement = SelectedProfile.GetAllLayers().FirstOrDefault(l => l.EntityId == layer.EntityId);
|
||||
OnSelectedProfileElementChanged(new RenderProfileElementEventArgs(SelectedProfileElement, previousSelectedProfileElement));
|
||||
// Trigger selected data binding change
|
||||
if (SelectedDataBinding != null)
|
||||
{
|
||||
SelectedDataBinding = SelectedProfileElement?.GetAllLayerProperties()?.FirstOrDefault(p => p.Path == SelectedDataBinding.Path);
|
||||
OnSelectedDataBindingChanged();
|
||||
}
|
||||
|
||||
UpdateProfilePreview();
|
||||
}
|
||||
|
||||
public event EventHandler<ProfileEventArgs> ProfileSelected;
|
||||
public event EventHandler<ProfileEventArgs> SelectedProfileUpdated;
|
||||
public event EventHandler<RenderProfileElementEventArgs> ProfileElementSelected;
|
||||
|
||||
Reference in new issue
Block a user