mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Settings - Fix general tab breaking when there is no graphics context
This commit is contained in:
parent
b3b324697a
commit
0256a0d625
@ -15,6 +15,7 @@ using Artemis.UI.Shared;
|
||||
using Avalonia;
|
||||
using DynamicData;
|
||||
using FluentAvalonia.Styling;
|
||||
using Ninject;
|
||||
using ReactiveUI;
|
||||
using Serilog.Events;
|
||||
|
||||
@ -27,7 +28,7 @@ namespace Artemis.UI.Screens.Settings
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly FluentAvaloniaTheme _fluentAvaloniaTheme;
|
||||
|
||||
public GeneralTabViewModel(ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService, IGraphicsContextProvider? graphicsContextProvider)
|
||||
public GeneralTabViewModel(IKernel kernel, ISettingsService settingsService, IPluginManagementService pluginManagementService, IDebugService debugService)
|
||||
{
|
||||
DisplayName = "General";
|
||||
_settingsService = settingsService;
|
||||
@ -37,6 +38,7 @@ namespace Artemis.UI.Screens.Settings
|
||||
List<LayerBrushProvider> layerBrushProviders = pluginManagementService.GetFeaturesOfType<LayerBrushProvider>();
|
||||
LayerBrushDescriptors = new ObservableCollection<LayerBrushDescriptor>(layerBrushProviders.SelectMany(l => l.LayerBrushDescriptors));
|
||||
GraphicsContexts = new ObservableCollection<string> {"Software"};
|
||||
IGraphicsContextProvider? graphicsContextProvider = kernel.TryGet<IGraphicsContextProvider>();
|
||||
if (graphicsContextProvider != null)
|
||||
GraphicsContexts.AddRange(graphicsContextProvider.GraphicsContextNames);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user