mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Layer brushes - Added RGB.NET-based layer brushes
Layer brushes - Added sample RGB.NET-based color brush Layer properties - Save on gradient edit dialog close Layer properties - Fix layer brush keyframes not working after changing layer brush
This commit is contained in:
1 parent
493790f6bd
commit
cdb91021a2
31 files changed
+550
-146
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
@@ -8,6 +9,7 @@ using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Colors;
|
||||
using Artemis.UI.Shared.Annotations;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Shared.Controls
|
||||
{
|
||||
@@ -19,6 +21,9 @@ namespace Artemis.UI.Shared.Controls
|
||||
private static IGradientPickerService _gradientPickerService;
|
||||
private bool _inCallback;
|
||||
|
||||
public event EventHandler DialogOpened;
|
||||
public event EventHandler DialogClosed;
|
||||
|
||||
public GradientPicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -77,7 +82,12 @@ namespace Artemis.UI.Shared.Controls
|
||||
|
||||
private void UIElement_OnMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
GradientPickerService.ShowGradientPicker(ColorGradient, DialogHost);
|
||||
Execute.OnUIThread(async () =>
|
||||
{
|
||||
OnDialogOpened();
|
||||
await GradientPickerService.ShowGradientPicker(ColorGradient, DialogHost);
|
||||
OnDialogClosed();
|
||||
});
|
||||
}
|
||||
|
||||
#region Static WPF fields
|
||||
@@ -92,5 +102,15 @@ namespace Artemis.UI.Shared.Controls
|
||||
EventManager.RegisterRoutedEvent(nameof(ColorGradient), RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<ColorGradient>), typeof(GradientPicker));
|
||||
|
||||
#endregion
|
||||
|
||||
protected virtual void OnDialogOpened()
|
||||
{
|
||||
DialogOpened?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnDialogClosed()
|
||||
{
|
||||
DialogClosed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Colors;
|
||||
using Artemis.UI.Shared.Screens.GradientEditor;
|
||||
@@ -15,12 +16,11 @@ namespace Artemis.UI.Shared.Services
|
||||
_dialogService = dialogService;
|
||||
}
|
||||
|
||||
public void ShowGradientPicker(ColorGradient colorGradient, string dialogHost)
|
||||
public Task<object> ShowGradientPicker(ColorGradient colorGradient, string dialogHost)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(dialogHost))
|
||||
_dialogService.ShowDialogAt<GradientEditorViewModel>(dialogHost, new Dictionary<string, object> {{"colorGradient", colorGradient}});
|
||||
else
|
||||
_dialogService.ShowDialog<GradientEditorViewModel>(new Dictionary<string, object> {{"colorGradient", colorGradient}});
|
||||
return _dialogService.ShowDialogAt<GradientEditorViewModel>(dialogHost, new Dictionary<string, object> {{"colorGradient", colorGradient}});
|
||||
return _dialogService.ShowDialog<GradientEditorViewModel>(new Dictionary<string, object> {{"colorGradient", colorGradient}});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
using Artemis.Core.Models.Profile;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Models.Profile;
|
||||
using Artemis.Core.Models.Profile.Colors;
|
||||
|
||||
namespace Artemis.UI.Shared.Services.Interfaces
|
||||
{
|
||||
public interface IGradientPickerService : IArtemisSharedUIService
|
||||
{
|
||||
void ShowGradientPicker(ColorGradient colorGradient, string dialogHost);
|
||||
Task<object> ShowGradientPicker(ColorGradient colorGradient, string dialogHost);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user