mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Settings - Fix general tab breaking when there is no graphics context
This commit is contained in:
1 parent
b3b324697a
commit
0256a0d625
1 file changed
+3
-1
@@ -15,6 +15,7 @@ using Artemis.UI.Shared;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using DynamicData;
|
using DynamicData;
|
||||||
using FluentAvalonia.Styling;
|
using FluentAvalonia.Styling;
|
||||||
|
using Ninject;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ namespace Artemis.UI.Screens.Settings
|
|||||||
private readonly IDebugService _debugService;
|
private readonly IDebugService _debugService;
|
||||||
private readonly FluentAvaloniaTheme _fluentAvaloniaTheme;
|
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";
|
DisplayName = "General";
|
||||||
_settingsService = settingsService;
|
_settingsService = settingsService;
|
||||||
@@ -37,6 +38,7 @@ namespace Artemis.UI.Screens.Settings
|
|||||||
List<LayerBrushProvider> layerBrushProviders = pluginManagementService.GetFeaturesOfType<LayerBrushProvider>();
|
List<LayerBrushProvider> layerBrushProviders = pluginManagementService.GetFeaturesOfType<LayerBrushProvider>();
|
||||||
LayerBrushDescriptors = new ObservableCollection<LayerBrushDescriptor>(layerBrushProviders.SelectMany(l => l.LayerBrushDescriptors));
|
LayerBrushDescriptors = new ObservableCollection<LayerBrushDescriptor>(layerBrushProviders.SelectMany(l => l.LayerBrushDescriptors));
|
||||||
GraphicsContexts = new ObservableCollection<string> {"Software"};
|
GraphicsContexts = new ObservableCollection<string> {"Software"};
|
||||||
|
IGraphicsContextProvider? graphicsContextProvider = kernel.TryGet<IGraphicsContextProvider>();
|
||||||
if (graphicsContextProvider != null)
|
if (graphicsContextProvider != null)
|
||||||
GraphicsContexts.AddRange(graphicsContextProvider.GraphicsContextNames);
|
GraphicsContexts.AddRange(graphicsContextProvider.GraphicsContextNames);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user