mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Core - Implemented module priority
Settings UI - Module priority modification UI WIP
This commit is contained in:
1 parent
6a32ecc3a4
commit
04f2162bcd
12 files changed
+416
-63
No files matched your search
@@ -28,12 +28,12 @@
|
||||
</StackPanel.ContextMenu>
|
||||
<Grid Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<materialDesign:PackIcon Grid.Column="0" Kind="Layers" Width="16" VerticalAlignment="Center"/>
|
||||
<materialDesign:PackIcon Grid.Column="0" Kind="Layers" Width="16" VerticalAlignment="Center" />
|
||||
<materialDesign:PackIcon Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Kind="{Binding Layer.LayerBrush.Descriptor.Icon}"
|
||||
|
||||
@@ -271,6 +271,15 @@
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="MODULE PRIORITY" TextElement.Foreground="{DynamicResource MaterialDesignBody}">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel Margin="15" MaxWidth="800">
|
||||
<ContentControl xaml:View.Model="{Binding ModuleOrderViewModel}"></ContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="PLUGINS" TextElement.Foreground="{DynamicResource MaterialDesignBody}">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0 12 0 0">
|
||||
<DockPanel Margin="15" MaxWidth="1230" HorizontalAlignment="Center">
|
||||
|
||||
@@ -11,6 +11,7 @@ using Artemis.Core.Services.Storage.Interfaces;
|
||||
using Artemis.Core.Utilities;
|
||||
using Artemis.UI.Ninject.Factories;
|
||||
using Artemis.UI.Screens.Settings.Tabs.Devices;
|
||||
using Artemis.UI.Screens.Settings.Tabs.Modules;
|
||||
using Artemis.UI.Screens.Settings.Tabs.Plugins;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
@@ -22,12 +23,12 @@ namespace Artemis.UI.Screens.Settings
|
||||
{
|
||||
public class SettingsViewModel : MainScreenViewModel
|
||||
{
|
||||
public ModuleOrderViewModel ModuleOrderViewModel { get; }
|
||||
private readonly IDebugService _debugService;
|
||||
private readonly IDeviceSettingsVmFactory _deviceSettingsVmFactory;
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly IPluginService _pluginService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly IPluginSettingsVmFactory _pluginSettingsVmFactory;
|
||||
private readonly ISettingsVmFactory _settingsVmFactory;
|
||||
private readonly ISurfaceService _surfaceService;
|
||||
private List<Tuple<string, int>> _targetFrameRates;
|
||||
private List<Tuple<string, double>> _renderScales;
|
||||
@@ -35,9 +36,15 @@ namespace Artemis.UI.Screens.Settings
|
||||
private BindableCollection<DeviceSettingsViewModel> _deviceSettingsViewModels;
|
||||
private BindableCollection<PluginSettingsViewModel> _plugins;
|
||||
|
||||
public SettingsViewModel(ISurfaceService surfaceService, IPluginService pluginService, IDialogService dialogService, IDebugService debugService,
|
||||
ISettingsService settingsService, IPluginSettingsVmFactory pluginSettingsVmFactory, IDeviceSettingsVmFactory deviceSettingsVmFactory)
|
||||
public SettingsViewModel(ISurfaceService surfaceService,
|
||||
IPluginService pluginService,
|
||||
IDialogService dialogService,
|
||||
IDebugService debugService,
|
||||
ISettingsService settingsService,
|
||||
ISettingsVmFactory settingsVmFactory,
|
||||
ModuleOrderViewModel moduleOrderViewModel)
|
||||
{
|
||||
ModuleOrderViewModel = moduleOrderViewModel;
|
||||
DisplayName = "Settings";
|
||||
|
||||
_surfaceService = surfaceService;
|
||||
@@ -45,8 +52,7 @@ namespace Artemis.UI.Screens.Settings
|
||||
_dialogService = dialogService;
|
||||
_debugService = debugService;
|
||||
_settingsService = settingsService;
|
||||
_pluginSettingsVmFactory = pluginSettingsVmFactory;
|
||||
_deviceSettingsVmFactory = deviceSettingsVmFactory;
|
||||
_settingsVmFactory = settingsVmFactory;
|
||||
|
||||
DeviceSettingsViewModels = new BindableCollection<DeviceSettingsViewModel>();
|
||||
Plugins = new BindableCollection<PluginSettingsViewModel>();
|
||||
@@ -225,10 +231,10 @@ namespace Artemis.UI.Screens.Settings
|
||||
Task.Run(ApplyAutorun);
|
||||
|
||||
DeviceSettingsViewModels.Clear();
|
||||
DeviceSettingsViewModels.AddRange(_surfaceService.ActiveSurface.Devices.Select(d => _deviceSettingsVmFactory.Create(d)));
|
||||
DeviceSettingsViewModels.AddRange(_surfaceService.ActiveSurface.Devices.Select(d => _settingsVmFactory.CreateDeviceSettingsViewModel(d)));
|
||||
|
||||
Plugins.Clear();
|
||||
Plugins.AddRange(_pluginService.GetAllPluginInfo().Select(p => _pluginSettingsVmFactory.Create(p.Instance)));
|
||||
Plugins.AddRange(_pluginService.GetAllPluginInfo().Select(p => _settingsVmFactory.CreatePluginSettingsViewModel(p.Instance)));
|
||||
|
||||
base.OnInitialActivate();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
<UserControl x:Class="Artemis.UI.Screens.Settings.Tabs.Modules.ModuleOrderView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Tabs.Modules"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Profile editor settings -->
|
||||
<StackPanel>
|
||||
<Grid Margin="0 15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}">Overlays</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Style="{StaticResource MaterialDesignCaptionTextBlock}"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="10 0">
|
||||
Modules that should always render on top
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Margin="0,0,5,0">
|
||||
<StackPanel Margin="15">
|
||||
<ListBox>
|
||||
<TextBlock>
|
||||
Plain
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Old
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
ListBox
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Full of junk
|
||||
</TextBlock>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<Grid Margin="0 15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}">Applications/games</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Style="{StaticResource MaterialDesignCaptionTextBlock}"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="10 0">
|
||||
Modules that are related to specific applications or games
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Margin="0,0,5,0">
|
||||
<StackPanel Margin="15">
|
||||
<ListBox>
|
||||
<TextBlock>
|
||||
Plain
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Old
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
ListBox
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Full of junk
|
||||
</TextBlock>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="2">
|
||||
<Grid Margin="0 15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}">Normal</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Style="{StaticResource MaterialDesignCaptionTextBlock}"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="10 0">
|
||||
Regular modules that are always active in the background
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Margin="0,0,5,0">
|
||||
<StackPanel Margin="15">
|
||||
<ListBox>
|
||||
<TextBlock>
|
||||
Plain
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Old
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
ListBox
|
||||
</TextBlock>
|
||||
<TextBlock>
|
||||
Full of junk
|
||||
</TextBlock>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Settings.Tabs.Modules
|
||||
{
|
||||
public class ModuleOrderViewModel : PropertyChangedBase
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user