mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +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
@@ -142,7 +142,10 @@ namespace Artemis.UI.Shared
|
||||
Point scaledPosition = new(x * Device.Rectangle.Width, y * Device.Rectangle.Height);
|
||||
DeviceVisualizerLed? deviceVisualizerLed = _deviceVisualizerLeds.FirstOrDefault(l => l.HitTest(scaledPosition));
|
||||
if (deviceVisualizerLed != null)
|
||||
OnLedClicked(new LedClickedEventArgs(deviceVisualizerLed.Led.Device, deviceVisualizerLed.Led));
|
||||
{
|
||||
OnLedClicked(new LedClickedEventArgs(deviceVisualizerLed.Led.Device, deviceVisualizerLed.Led, e));
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void DevicePropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
|
||||
@@ -1,27 +1,33 @@
|
||||
using System;
|
||||
using Artemis.Core;
|
||||
using Avalonia.Input;
|
||||
|
||||
namespace Artemis.UI.Shared.Events
|
||||
namespace Artemis.UI.Shared.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Provides data on LED click events raised by the device visualizer
|
||||
/// </summary>
|
||||
public class LedClickedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides data on LED click events raised by the device visualizer
|
||||
/// </summary>
|
||||
public class LedClickedEventArgs : EventArgs
|
||||
internal LedClickedEventArgs(ArtemisDevice device, ArtemisLed led, PointerReleasedEventArgs pointerReleasedEventArgs)
|
||||
{
|
||||
internal LedClickedEventArgs(ArtemisDevice device, ArtemisLed led)
|
||||
{
|
||||
Device = device;
|
||||
Led = led;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The device that was clicked
|
||||
/// </summary>
|
||||
public ArtemisDevice Device { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The LED that was clicked
|
||||
/// </summary>
|
||||
public ArtemisLed Led { get; set; }
|
||||
Device = device;
|
||||
Led = led;
|
||||
PointerReleasedEventArgs = pointerReleasedEventArgs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the device that was clicked.
|
||||
/// </summary>
|
||||
public ArtemisDevice Device { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the LED that was clicked.
|
||||
/// </summary>
|
||||
public ArtemisLed Led { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the original pointer released event arguments.
|
||||
/// </summary>
|
||||
public PointerReleasedEventArgs PointerReleasedEventArgs { get; }
|
||||
}
|
||||
Reference in new issue
Block a user