mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Devices - Added option to disable default layouts
This commit is contained in:
1 parent
fb3f7e0cc1
commit
cef37677f2
6 files changed
+117
-10
No files matched your search
@@ -354,19 +354,26 @@ namespace Artemis.Core.Services
|
||||
}
|
||||
|
||||
// Finally fall back to a default layout
|
||||
layout = ArtemisLayout.GetDefaultLayout(device);
|
||||
if (layout != null)
|
||||
ApplyDeviceLayout(device, layout);
|
||||
if (!device.DisableDefaultLayout)
|
||||
layout = ArtemisLayout.GetDefaultLayout(device);
|
||||
ApplyDeviceLayout(device, layout);
|
||||
return layout;
|
||||
}
|
||||
|
||||
public void ApplyDeviceLayout(ArtemisDevice device, ArtemisLayout layout)
|
||||
public void ApplyDeviceLayout(ArtemisDevice device, ArtemisLayout? layout)
|
||||
{
|
||||
if (layout == null)
|
||||
{
|
||||
if (device.Layout != null)
|
||||
device.ClearLayout();
|
||||
return;
|
||||
}
|
||||
|
||||
if (layout.Source == LayoutSource.Default)
|
||||
device.ApplyLayout(layout, false, false);
|
||||
else
|
||||
device.ApplyLayout(layout, device.DeviceProvider.CreateMissingLedsSupported, device.DeviceProvider.RemoveExcessiveLedsSupported);
|
||||
|
||||
|
||||
UpdateLedGroup();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user