mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-02-04 10:53:31 +00:00
Made the UI save automatically, removed apply and reset buttons
This commit is contained in:
parent
480e0b9b12
commit
5ef6c4b8a7
@ -5,7 +5,7 @@
|
|||||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
|
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
|
||||||
xmlns:device="clr-namespace:Artemis.UI.Screens.Device"
|
xmlns:device="clr-namespace:Artemis.UI.Screens.Device"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="650"
|
||||||
x:Class="Artemis.UI.Screens.Device.DeviceGeneralTabView"
|
x:Class="Artemis.UI.Screens.Device.DeviceGeneralTabView"
|
||||||
x:DataType="device:DeviceGeneralTabViewModel">
|
x:DataType="device:DeviceGeneralTabViewModel">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
@ -138,7 +138,7 @@
|
|||||||
<Border Grid.Row="1" Grid.Column="1" Classes="card" Margin="5" x:Name="CalibrationBorder">
|
<Border Grid.Row="1" Grid.Column="1" Classes="card" Margin="5" x:Name="CalibrationBorder">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBlock TextWrapping="Wrap" Text="Use the sliders below to adjust the colors of your device so that it matches your other devices." />
|
<TextBlock TextWrapping="Wrap" Text="Use the sliders below to adjust the colors of your device so that it matches your other devices." />
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,*,*,*">
|
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,*,*">
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="R" VerticalAlignment="Center" />
|
<Label Grid.Row="0" Grid.Column="0" Content="R" VerticalAlignment="Center" />
|
||||||
<Slider Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="200" Value="{CompiledBinding RedScale}" Margin="10 0" VerticalAlignment="Center" />
|
<Slider Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="200" Value="{CompiledBinding RedScale}" Margin="10 0" VerticalAlignment="Center" />
|
||||||
<NumericUpDown Grid.Row="0"
|
<NumericUpDown Grid.Row="0"
|
||||||
@ -177,194 +177,33 @@
|
|||||||
Minimum="0"
|
Minimum="0"
|
||||||
Maximum="200"
|
Maximum="200"
|
||||||
ClipValueToMinMax="True" />
|
ClipValueToMinMax="True" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{CompiledBinding DisplayOnDevices}" Content="Show preview" VerticalAlignment="Center" />
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||||
<controls:ColorPickerButton Grid.Row="3"
|
<Button
|
||||||
Grid.Column="2"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
Content="Reset"
|
||||||
HorizontalAlignment="Right"
|
ToolTip.Tip="Reset the color scaling to what it had previously"
|
||||||
Color="{CompiledBinding CurrentColor, Converter={StaticResource SKColorToColorConverter}}"
|
Command="{CompiledBinding ResetScaling}"
|
||||||
ShowAcceptDismissButtons="False" />
|
HorizontalAlignment="Center"/>
|
||||||
|
<CheckBox Grid.Column="1" IsChecked="{CompiledBinding DisplayOnDevices}" Content="Preview specific color" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
||||||
|
|
||||||
|
<controls:ColorPickerButton Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Color="{CompiledBinding CurrentColor, Converter={StaticResource SKColorToColorConverter}}"
|
||||||
|
ShowAcceptDismissButtons="False" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Stacked instead of grid here: -->
|
<Button Grid.Row="1" Margin="5"
|
||||||
<!-- <StackPanel Grid.Row="0"> -->
|
IsVisible="{CompiledBinding RequiresManualSetup}"
|
||||||
<!-- <TextBlock Classes="card-title" Text="Information" Margin="10,0,0,0" /> -->
|
Command="{CompiledBinding RestartSetup}"
|
||||||
<!-- <Border Classes="card" Margin="5" x:Name="InformationBorder"> -->
|
ToolTip.Tip="Restart device setup, allowing you to select a new physical and logical layout">
|
||||||
<!-- <Grid ColumnDefinitions="*,Auto" RowDefinitions="*,*,*,*,*,*"> -->
|
Restart setup
|
||||||
<!-- <TextBlock Grid.Column="0" Grid.Row="0" Text="Model" /> -->
|
</Button>
|
||||||
<!-- <TextBlock Grid.Column="1" Grid.Row="0" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.RgbDevice.DeviceInfo.Model}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Column="0" Grid.Row="1" Text="Manufacturer" /> -->
|
|
||||||
<!-- <TextBlock Grid.Column="1" Grid.Row="1" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.RgbDevice.DeviceInfo.Manufacturer}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Column="0" Grid.Row="2" Text="Device Type" /> -->
|
|
||||||
<!-- <TextBlock Grid.Column="1" Grid.Row="2" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.RgbDevice.DeviceInfo.DeviceType}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Column="0" Grid.Row="3" Text="Size (1px = 1mm)" /> -->
|
|
||||||
<!-- <TextBlock Grid.Column="1" Grid.Row="3" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.RgbDevice.Size}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock IsVisible="{CompiledBinding IsKeyboard}" Grid.Column="0" Grid.Row="4" Text="Physical Layout" /> -->
|
|
||||||
<!-- <TextBlock IsVisible="{CompiledBinding IsKeyboard}" Grid.Column="1" Grid.Row="4" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.PhysicalLayout}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock IsVisible="{CompiledBinding IsKeyboard}" Grid.Column="0" Grid.Row="5" Text="Logical Layout" /> -->
|
|
||||||
<!-- <TextBlock IsVisible="{CompiledBinding IsKeyboard}" Grid.Column="1" Grid.Row="5" Classes="subtitle" TextWrapping="Wrap" Text="{CompiledBinding Device.LogicalLayout}" /> -->
|
|
||||||
<!-- </Grid> -->
|
|
||||||
<!-- </Border> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Classes="card-title" Text="Categories" Margin="10,0,0,0" /> -->
|
|
||||||
<!-- <Border Classes="card" Margin="5" x:Name="CategoryBorder"> -->
|
|
||||||
<!-- <StackPanel> -->
|
|
||||||
<!-- <TextBlock TextWrapping="Wrap" Text="Artemis uses categories to determine where the layers of imported profiles are applied to." /> -->
|
|
||||||
<!-- <Grid ColumnDefinitions="*,Auto" RowDefinitions="*,*,*,*,*" Margin="0,10,0,0"> -->
|
|
||||||
<!-- <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,0,10"> -->
|
|
||||||
<!-- <TextBlock Text="Peripheral" /> -->
|
|
||||||
<!-- <TextBlock Classes="subtitle" FontSize="12" TextWrapping="Wrap" Text="A peripheral such as a mouse or keyboard" /> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- <CheckBox Grid.Row="0" Grid.Column="1" IsChecked="{CompiledBinding HasPeripheralsCategory}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,0,10"> -->
|
|
||||||
<!-- <TextBlock Text="Desk" /> -->
|
|
||||||
<!-- <TextBlock Classes="subtitle" FontSize="12" TextWrapping="Wrap" Text="A device acting as desk ornamentation such as a LED strip" /> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- <CheckBox Grid.Row="1" Grid.Column="1" IsChecked="{CompiledBinding HasDeskCategory}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <StackPanel Grid.Row="2" Grid.Column="0" Margin="0,0,0,10"> -->
|
|
||||||
<!-- <TextBlock Text="Monitor" /> -->
|
|
||||||
<!-- <TextBlock Classes="subtitle" FontSize="12" TextWrapping="Wrap" Text="A device attached to the monitor such as ambilight LEDs" /> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{CompiledBinding HasMonitorCategory}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <StackPanel Grid.Row="3" Grid.Column="0" Margin="0,0,0,10"> -->
|
|
||||||
<!-- <TextBlock Text="Case" /> -->
|
|
||||||
<!-- <TextBlock Classes="subtitle" FontSize="12" TextWrapping="Wrap" Text="A device inside your computer case" /> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- <CheckBox Grid.Row="3" Grid.Column="1" IsChecked="{CompiledBinding HasCaseCategory}" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <StackPanel Grid.Row="4" Grid.Column="0" Margin="0,0,0,10"> -->
|
|
||||||
<!-- <TextBlock Text="Room" /> -->
|
|
||||||
<!-- <TextBlock Classes="subtitle" FontSize="12" TextWrapping="Wrap" Text="A device elsewhere in the room" /> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- <CheckBox Grid.Row="4" Grid.Column="1" IsChecked="{CompiledBinding HasRoomCategory}" /> -->
|
|
||||||
<!-- </Grid> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- </Border> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Classes="card-title" Text="Surface" Margin="10,0,0,0" /> -->
|
|
||||||
<!-- <Border Classes="card" Margin="5" x:Name="SurfaceBorder"> -->
|
|
||||||
<!-- <StackPanel Orientation="Vertical"> -->
|
|
||||||
<!-- <TextBlock TextWrapping="Wrap" Text="The device can be rotated and scaled on the surface with the values below." /> -->
|
|
||||||
<!-- <Grid ColumnDefinitions="*,Auto,Auto" RowDefinitions="*,*,*,*"> -->
|
|
||||||
<!-- <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">X-coordinate</TextBlock> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="0" -->
|
|
||||||
<!-- Grid.Column="1" -->
|
|
||||||
<!-- Margin="10 5" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Value="{CompiledBinding X}" /> -->
|
|
||||||
<!-- <TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">Y-coordinate</TextBlock> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="1" -->
|
|
||||||
<!-- Grid.Column="1" -->
|
|
||||||
<!-- Margin="10 5" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Value="{CompiledBinding Y}" /> -->
|
|
||||||
<!-- <TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Scale</TextBlock> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="2" -->
|
|
||||||
<!-- Grid.Column="1" -->
|
|
||||||
<!-- Margin="10 5" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Increment="0.1" -->
|
|
||||||
<!-- FormatString="F1" -->
|
|
||||||
<!-- Value="{CompiledBinding Scale}" /> -->
|
|
||||||
<!-- <TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center">times</TextBlock> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Rotation</TextBlock> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="3" -->
|
|
||||||
<!-- Grid.Column="1" -->
|
|
||||||
<!-- Margin="10 5" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Value="{CompiledBinding Rotation}" /> -->
|
|
||||||
<!-- <TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">deg</TextBlock> -->
|
|
||||||
<!-- </Grid> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- </Border> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <TextBlock Classes="card-title" Text="Calibration" Margin="10,0,0,0" /> -->
|
|
||||||
<!-- <Border Classes="card" Margin="5" x:Name="CalibrationBorder"> -->
|
|
||||||
<!-- <StackPanel Orientation="Vertical"> -->
|
|
||||||
<!-- <TextBlock TextWrapping="Wrap" Text="Use the sliders below to adjust the colors of your device so that it matches your other devices." /> -->
|
|
||||||
<!-- <Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,*,*,*"> -->
|
|
||||||
<!-- <Label Grid.Row="0" Grid.Column="0" Content="R" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <Slider Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="200" Value="{CompiledBinding RedScale}" Margin="10 0" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="0" -->
|
|
||||||
<!-- Grid.Column="2" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Width="65" -->
|
|
||||||
<!-- Value="{CompiledBinding RedScale}" -->
|
|
||||||
<!-- ShowButtonSpinner="False" -->
|
|
||||||
<!-- FormatString="{}{0:0.0}" -->
|
|
||||||
<!-- Minimum="0" -->
|
|
||||||
<!-- Maximum="200" -->
|
|
||||||
<!-- ClipValueToMinMax="True" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <Label Grid.Row="1" Grid.Column="0" Content="G" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <Slider Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="200" Value="{CompiledBinding GreenScale}" Margin="10 0" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="1" -->
|
|
||||||
<!-- Grid.Column="2" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Width="65" -->
|
|
||||||
<!-- Value="{CompiledBinding GreenScale}" -->
|
|
||||||
<!-- ShowButtonSpinner="False" -->
|
|
||||||
<!-- FormatString="{}{0:0.0}" -->
|
|
||||||
<!-- Minimum="0" -->
|
|
||||||
<!-- Maximum="200" -->
|
|
||||||
<!-- ClipValueToMinMax="True" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <Label Grid.Row="2" Grid.Column="0" Content="B" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <Slider Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="200" Value="{CompiledBinding BlueScale}" Margin="10 0" Ticks="100" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <NumericUpDown Grid.Row="2" -->
|
|
||||||
<!-- Grid.Column="2" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- Width="65" -->
|
|
||||||
<!-- Value="{CompiledBinding BlueScale}" -->
|
|
||||||
<!-- ShowButtonSpinner="False" -->
|
|
||||||
<!-- FormatString="{}{0:0.0}" -->
|
|
||||||
<!-- Minimum="0" -->
|
|
||||||
<!-- Maximum="200" -->
|
|
||||||
<!-- ClipValueToMinMax="True" /> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{CompiledBinding DisplayOnDevices}" Content="Show preview" VerticalAlignment="Center" /> -->
|
|
||||||
<!-- <controls:ColorPickerButton Grid.Row="3" -->
|
|
||||||
<!-- Grid.Column="2" -->
|
|
||||||
<!-- VerticalAlignment="Center" -->
|
|
||||||
<!-- HorizontalAlignment="Right" -->
|
|
||||||
<!-- Color="{CompiledBinding CurrentColor, Converter={StaticResource SKColorToColorConverter}}" -->
|
|
||||||
<!-- ShowAcceptDismissButtons="False" /> -->
|
|
||||||
<!-- </Grid> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
<!-- </Border> -->
|
|
||||||
<!-- </StackPanel> -->
|
|
||||||
|
|
||||||
<Grid Grid.Row="1" ColumnDefinitions="Auto,*" Margin="5">
|
|
||||||
<Button Grid.Column="0"
|
|
||||||
IsVisible="{CompiledBinding RequiresManualSetup}"
|
|
||||||
Command="{CompiledBinding RestartSetup}"
|
|
||||||
ToolTip.Tip="Restart device setup, allowing you to select a new physical and logical layout">
|
|
||||||
Restart setup
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
||||||
<Button IsCancel="True" Command="{CompiledBinding Reset}" Margin="0 0 5 0" Content="Reset" />
|
|
||||||
<Button Classes="accent" IsDefault="True" Command="{CompiledBinding Apply}" Content="Apply" />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using System.ComponentModel;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Artemis.Core;
|
using Artemis.Core;
|
||||||
using Artemis.Core.Services;
|
using Artemis.Core.Services;
|
||||||
@ -15,6 +16,7 @@ using RGB.NET.Core;
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.UI.Screens.Device;
|
namespace Artemis.UI.Screens.Device;
|
||||||
|
|
||||||
public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
||||||
{
|
{
|
||||||
private readonly ICoreService _coreService;
|
private readonly ICoreService _coreService;
|
||||||
@ -46,10 +48,10 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
|
|
||||||
Device = device;
|
Device = device;
|
||||||
DisplayName = "General";
|
DisplayName = "General";
|
||||||
X = (int) Device.X;
|
X = (int)Device.X;
|
||||||
Y = (int) Device.Y;
|
Y = (int)Device.Y;
|
||||||
Scale = Device.Scale;
|
Scale = Device.Scale;
|
||||||
Rotation = (int) Device.Rotation;
|
Rotation = (int)Device.Rotation;
|
||||||
RedScale = Device.RedScale * 100f;
|
RedScale = Device.RedScale * 100f;
|
||||||
GreenScale = Device.GreenScale * 100f;
|
GreenScale = Device.GreenScale * 100f;
|
||||||
BlueScale = Device.BlueScale * 100f;
|
BlueScale = Device.BlueScale * 100f;
|
||||||
@ -71,6 +73,7 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
{
|
{
|
||||||
_coreService.FrameRendering -= OnFrameRendering;
|
_coreService.FrameRendering -= OnFrameRendering;
|
||||||
Device.PropertyChanged -= DeviceOnPropertyChanged;
|
Device.PropertyChanged -= DeviceOnPropertyChanged;
|
||||||
|
Apply();
|
||||||
}).DisposeWith(d);
|
}).DisposeWith(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -165,15 +168,6 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
set => RaiseAndSetIfChanged(ref _displayOnDevices, value);
|
set => RaiseAndSetIfChanged(ref _displayOnDevices, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyScaling()
|
|
||||||
{
|
|
||||||
Device.RedScale = RedScale / 100f;
|
|
||||||
Device.GreenScale = GreenScale / 100f;
|
|
||||||
Device.BlueScale = BlueScale / 100f;
|
|
||||||
|
|
||||||
_rgbService.FlushLeds = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool GetCategory(DeviceCategory category)
|
private bool GetCategory(DeviceCategory category)
|
||||||
{
|
{
|
||||||
return _categories.Contains(category);
|
return _categories.Contains(category);
|
||||||
@ -203,12 +197,12 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
_rgbService.ApplyBestDeviceLayout(Device);
|
_rgbService.ApplyBestDeviceLayout(Device);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Apply()
|
private void Apply()
|
||||||
{
|
{
|
||||||
// TODO: Validation
|
// TODO: Validation
|
||||||
|
|
||||||
_coreService.ProfileRenderingDisabled = true;
|
_coreService.ProfileRenderingDisabled = true;
|
||||||
await Task.Delay(100);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
Device.X = X;
|
Device.X = X;
|
||||||
Device.Y = Y;
|
Device.Y = Y;
|
||||||
@ -226,14 +220,17 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
_coreService.ProfileRenderingDisabled = false;
|
_coreService.ProfileRenderingDisabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void ApplyScaling()
|
||||||
{
|
{
|
||||||
HasDeskCategory = Device.Categories.Contains(DeviceCategory.Desk);
|
Device.RedScale = RedScale / 100f;
|
||||||
HasMonitorCategory = Device.Categories.Contains(DeviceCategory.Monitor);
|
Device.GreenScale = GreenScale / 100f;
|
||||||
HasCaseCategory = Device.Categories.Contains(DeviceCategory.Case);
|
Device.BlueScale = BlueScale / 100f;
|
||||||
HasRoomCategory = Device.Categories.Contains(DeviceCategory.Room);
|
|
||||||
HasPeripheralsCategory = Device.Categories.Contains(DeviceCategory.Peripherals);
|
|
||||||
|
|
||||||
|
_rgbService.FlushLeds = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ResetScaling()
|
||||||
|
{
|
||||||
RedScale = _initialRedScale * 100;
|
RedScale = _initialRedScale * 100;
|
||||||
GreenScale = _initialGreenScale * 100;
|
GreenScale = _initialGreenScale * 100;
|
||||||
BlueScale = _initialBlueScale * 100;
|
BlueScale = _initialBlueScale * 100;
|
||||||
@ -244,7 +241,7 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
|
|||||||
if (!DisplayOnDevices)
|
if (!DisplayOnDevices)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using SKPaint overlayPaint = new() {Color = CurrentColor};
|
using SKPaint overlayPaint = new() { Color = CurrentColor };
|
||||||
e.Canvas.DrawRect(0, 0, e.Canvas.LocalClipBounds.Width, e.Canvas.LocalClipBounds.Height, overlayPaint);
|
e.Canvas.DrawRect(0, 0, e.Canvas.LocalClipBounds.Width, e.Canvas.LocalClipBounds.Height, overlayPaint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user