mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +00:00
Surface editor - Added option to only light the top-left LED of a device
This commit is contained in:
parent
eaa1f15ac3
commit
c51016f8f2
@ -209,6 +209,13 @@
|
|||||||
ToolTip="If selected, each device is completely lid up with a random color">
|
ToolTip="If selected, each device is completely lid up with a random color">
|
||||||
Show random device colors
|
Show random device colors
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
<CheckBox Style="{StaticResource MaterialDesignCheckBox}"
|
||||||
|
IsChecked="{Binding ColorFirstLedOnly}"
|
||||||
|
IsEnabled="{Binding ColorDevices}"
|
||||||
|
ToolTip="If selected, only the first LED of each device is lid up, aiding with rotation settings"
|
||||||
|
Margin="5 0 0 0">
|
||||||
|
Light up first LED only
|
||||||
|
</CheckBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@ -92,7 +92,18 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
|||||||
public bool ColorDevices
|
public bool ColorDevices
|
||||||
{
|
{
|
||||||
get => _colorDevices;
|
get => _colorDevices;
|
||||||
set => SetAndNotify(ref _colorDevices, value);
|
set
|
||||||
|
{
|
||||||
|
SetAndNotify(ref _colorDevices, value);
|
||||||
|
if (!value)
|
||||||
|
ColorFirstLedOnly = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ColorFirstLedOnly
|
||||||
|
{
|
||||||
|
get => _colorFirstLedOnly;
|
||||||
|
set => SetAndNotify(ref _colorFirstLedOnly, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenHyperlink(object sender, RequestNavigateEventArgs e)
|
public void OpenHyperlink(object sender, RequestNavigateEventArgs e)
|
||||||
@ -127,10 +138,18 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
|||||||
|
|
||||||
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
|
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
|
||||||
{
|
{
|
||||||
foreach (ArtemisLed artemisLed in listDeviceViewModel.Device.Leds)
|
// Order by position to accurately get the first LED
|
||||||
|
List<ArtemisLed> leds = listDeviceViewModel.Device.Leds.OrderBy(l => l.Rectangle.Left).ThenBy(l => l.Rectangle.Top).ToList();
|
||||||
|
for (int index = 0; index < leds.Count; index++)
|
||||||
|
{
|
||||||
|
ArtemisLed artemisLed = leds[index];
|
||||||
|
if (ColorFirstLedOnly && index > 0)
|
||||||
|
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = new SKColor(0, 0, 0)});
|
||||||
|
else
|
||||||
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
|
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Overrides of Screen
|
#region Overrides of Screen
|
||||||
|
|
||||||
@ -258,6 +277,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
|||||||
private MouseDragStatus _mouseDragStatus;
|
private MouseDragStatus _mouseDragStatus;
|
||||||
private Point _mouseDragStartPoint;
|
private Point _mouseDragStartPoint;
|
||||||
private bool _colorDevices;
|
private bool _colorDevices;
|
||||||
|
private bool _colorFirstLedOnly;
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global - Called from view
|
// ReSharper disable once UnusedMember.Global - Called from view
|
||||||
public void EditorGridMouseClick(object sender, MouseButtonEventArgs e)
|
public void EditorGridMouseClick(object sender, MouseButtonEventArgs e)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user