mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Code style - Use file scoped namespaces
Code style - Ran code cleanup
This commit is contained in:
1 parent
e68e16df4d
commit
f6090dc296
691 files changed
+37301
-38119
No files matched your search
@@ -14,10 +14,10 @@ namespace Artemis.UI.Screens.SurfaceEditor;
|
||||
|
||||
public class ListDeviceViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IWindowService _windowService;
|
||||
private readonly IRgbService _rgbService;
|
||||
private static readonly Random Random = new();
|
||||
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly IWindowService _windowService;
|
||||
|
||||
private SKColor _color;
|
||||
private bool _isSelected;
|
||||
|
||||
@@ -25,19 +25,19 @@ public class ListDeviceViewModel : ViewModelBase
|
||||
{
|
||||
_windowService = windowService;
|
||||
_rgbService = rgbService;
|
||||
|
||||
|
||||
Device = device;
|
||||
SurfaceEditorViewModel = surfaceEditorViewModel;
|
||||
Color = SKColor.FromHsv(Random.NextSingle() * 360, 95, 100);
|
||||
DetectInput = ReactiveCommand.CreateFromTask(ExecuteDetectInput, this.WhenAnyValue(vm => vm.CanDetectInput));
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit,Unit> DetectInput { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> DetectInput { get; }
|
||||
|
||||
public ArtemisDevice Device { get; }
|
||||
public SurfaceEditorViewModel SurfaceEditorViewModel { get; }
|
||||
public bool CanDetectInput => Device.DeviceType == RGBDeviceType.Keyboard || Device.DeviceType == RGBDeviceType.Mouse;
|
||||
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _isSelected;
|
||||
@@ -49,7 +49,7 @@ public class ListDeviceViewModel : ViewModelBase
|
||||
get => _color;
|
||||
set => RaiseAndSetIfChanged(ref _color, value);
|
||||
}
|
||||
|
||||
|
||||
private async Task ExecuteDetectInput()
|
||||
{
|
||||
if (!CanDetectInput)
|
||||
|
||||
@@ -35,12 +35,12 @@ public class SurfaceDeviceViewModel : ActivatableViewModelBase
|
||||
DetectInput = ReactiveCommand.CreateFromTask(ExecuteDetectInput, this.WhenAnyValue(vm => vm.CanDetectInput));
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit,Unit> DetectInput { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> DetectInput { get; }
|
||||
|
||||
public ArtemisDevice Device { get; }
|
||||
public SurfaceEditorViewModel SurfaceEditorViewModel { get; }
|
||||
public bool CanDetectInput => Device.DeviceType == RGBDeviceType.Keyboard || Device.DeviceType == RGBDeviceType.Mouse;
|
||||
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _isSelected;
|
||||
@@ -107,7 +107,7 @@ public class SurfaceDeviceViewModel : ActivatableViewModelBase
|
||||
|
||||
return !own.Any(o => others.Any(l => l.IntersectsWith(o)));
|
||||
}
|
||||
|
||||
|
||||
private async Task ExecuteDetectInput()
|
||||
{
|
||||
if (!CanDetectInput)
|
||||
|
||||
@@ -18,16 +18,16 @@ namespace Artemis.UI.Screens.SurfaceEditor;
|
||||
|
||||
public class SurfaceEditorViewModel : MainScreenViewModel
|
||||
{
|
||||
private readonly IDeviceService _deviceService;
|
||||
private readonly IDeviceVmFactory _deviceVmFactory;
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly IDeviceVmFactory _deviceVmFactory;
|
||||
private readonly IWindowService _windowService;
|
||||
private readonly IDeviceService _deviceService;
|
||||
private List<SurfaceDeviceViewModel>? _initialSelection;
|
||||
private bool _saving;
|
||||
private bool _colorFirstLedOnly;
|
||||
private bool _colorDevices;
|
||||
private bool _colorFirstLedOnly;
|
||||
private List<SurfaceDeviceViewModel>? _initialSelection;
|
||||
private double _overlayOpacity;
|
||||
private bool _saving;
|
||||
|
||||
public SurfaceEditorViewModel(IScreen hostScreen,
|
||||
ICoreService coreService,
|
||||
@@ -176,7 +176,7 @@ public class SurfaceEditorViewModel : MainScreenViewModel
|
||||
// Fill the entire canvas with a black backdrop
|
||||
paint.Color = SKColors.Black.WithAlpha(alpha);
|
||||
e.Canvas.DrawRect(e.Canvas.LocalClipBounds, paint);
|
||||
|
||||
|
||||
// Draw a rectangle for each LED
|
||||
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
|
||||
{
|
||||
@@ -185,7 +185,7 @@ public class SurfaceEditorViewModel : MainScreenViewModel
|
||||
for (int index = 0; index < leds.Count; index++)
|
||||
{
|
||||
ArtemisLed artemisLed = leds[index];
|
||||
if (ColorFirstLedOnly && index == 0 || !ColorFirstLedOnly)
|
||||
if ((ColorFirstLedOnly && index == 0) || !ColorFirstLedOnly)
|
||||
{
|
||||
paint.Color = listDeviceViewModel.Color.WithAlpha(alpha);
|
||||
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, paint);
|
||||
|
||||
Reference in new issue
Block a user