1
0
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:
Robert 2022-07-04 17:58:44 +02:00
parent b3b324697a
commit 0256a0d625

View File

@ -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);