1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Device dialog - Added LEDs tab

General - Resolved lots of compile warnings (XML comments)
This commit is contained in:
Robert 2022-06-19 14:19:03 +02:00
parent 021f17aef4
commit 65837e671a
44 changed files with 1015 additions and 761 deletions

View File

@ -19,6 +19,8 @@
<entry key="Artemis.UI.Shared/Controls/EnumComboBox.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI.Shared/Controls/EnumComboBox.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/Controls/HotkeyBox.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI.Shared/Controls/HotkeyBox.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI.Shared/Controls/ProfileConfigurationIcon.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/DefaultTypes/DataModel/Display/DefaultDataModelDisplayView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/DefaultTypes/DataModel/Display/SKColorDataModelDisplayView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/Styles/Border.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI.Shared/Styles/Border.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI.Shared/Styles/Condensed.axaml" value="Artemis.UI.Windows/Artemis.UI.Windows.csproj" /> <entry key="Artemis.UI.Shared/Styles/Condensed.axaml" value="Artemis.UI.Windows/Artemis.UI.Windows.csproj" />
<entry key="Artemis.UI.Shared/Styles/TextBlock.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI.Shared/Styles/TextBlock.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
@ -40,6 +42,7 @@
<entry key="Artemis.UI/Screens/Device/DevicePropertiesView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Device/DevicePropertiesView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Device/DeviceSettingsView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Device/DeviceSettingsView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Device/Tabs/DeviceInfoTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Device/Tabs/DeviceInfoTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Device/Tabs/DeviceLedsTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Device/Tabs/DevicePropertiesTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Device/Tabs/DevicePropertiesTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Device/Tabs/InputMappingsTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Device/Tabs/InputMappingsTabView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />
<entry key="Artemis.UI/Screens/Plugins/PluginFeatureView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" /> <entry key="Artemis.UI/Screens/Plugins/PluginFeatureView.axaml" value="Artemis.UI.Linux/Artemis.UI.Linux.csproj" />

View File

@ -153,7 +153,18 @@ namespace Artemis.Core.Services
/// <param name="color">The color to display</param> /// <param name="color">The color to display</param>
TypeColorRegistration RegisterTypeColor(Plugin plugin, Type type, SKColor color); TypeColorRegistration RegisterTypeColor(Plugin plugin, Type type, SKColor color);
/// <summary>
/// Exports the provided node script to JSON.
/// </summary>
/// <param name="nodeScript">The node script to export.</param>
/// <returns>The resulting JSON.</returns>
string ExportScript(NodeScript nodeScript); string ExportScript(NodeScript nodeScript);
/// <summary>
/// Imports the provided JSON onto the provided node script, overwriting any existing contents.
/// </summary>
/// <param name="json">The JSON to import.</param>
/// <param name="target">The target node script whose contents to overwrite.</param>
void ImportScript(string json, NodeScript target); void ImportScript(string json, NodeScript target);
} }
} }

View File

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<PreserveCompilationContext>false</PreserveCompilationContext> <PreserveCompilationContext>false</PreserveCompilationContext>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.11" /> <PackageReference Include="LiteDB" Version="5.0.11"/>
<PackageReference Include="Serilog" Version="2.10.0" /> <PackageReference Include="Serilog" Version="2.10.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**"/>
<None Remove=".gitignore" /> <None Remove=".gitignore"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15"/>
<PackageReference Include="Avalonia.Desktop" Version="0.10.15" /> <PackageReference Include="Avalonia.Desktop" Version="0.10.15"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15"/>
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj"/>
<ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj" /> <ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**"/>
<None Remove=".gitignore" /> <None Remove=".gitignore"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15"/>
<PackageReference Include="Avalonia.Desktop" Version="0.10.15" /> <PackageReference Include="Avalonia.Desktop" Version="0.10.15"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15"/>
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj"/>
<ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj" /> <ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -6,26 +6,36 @@
<members> <members>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.ArtemisIcon.IconProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.ArtemisIcon.IconProperty">
<summary> <summary>
Gets or sets the currently displayed icon as either a <see cref="T:Material.Icons.MaterialIconKind" /> or an <see cref="T:System.Uri" /> pointing Gets or sets the currently displayed icon as either a
<see cref="T:Material.Icons.MaterialIconKind"/>
or an
<see cref="T:System.Uri"/>
pointing
to an SVG to an SVG
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Controls.ArtemisIcon.Icon"> <member name="P:Artemis.UI.Avalonia.Shared.Controls.ArtemisIcon.Icon">
<summary> <summary>
Gets or sets the currently displayed icon as either a <see cref="T:Material.Icons.MaterialIconKind" /> or an <see cref="T:System.Uri" /> pointing Gets or sets the currently displayed icon as either a
<see cref="T:Material.Icons.MaterialIconKind"/>
or an
<see cref="T:System.Uri"/>
pointing
to an SVG to an SVG
</summary> </summary>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer"> <member name="T:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer">
<summary> <summary>
Visualizes an <see cref="T:Artemis.Core.ArtemisDevice" /> with optional per-LED colors Visualizes an
<see cref="T:Artemis.Core.ArtemisDevice"/>
with optional per-LED colors
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.#ctor"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.#ctor">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.Render(Avalonia.Media.DrawingContext)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.Render(Avalonia.Media.DrawingContext)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="E:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.LedClicked"> <member name="E:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.LedClicked">
<summary> <summary>
@ -34,23 +44,29 @@
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnLedClicked(Artemis.UI.Avalonia.Shared.Events.LedClickedEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnLedClicked(Artemis.UI.Avalonia.Shared.Events.LedClickedEventArgs)">
<summary> <summary>
Invokes the <see cref="E:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.LedClicked" /> event Invokes the
<see cref="E:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.LedClicked"/>
event
</summary> </summary>
<param name="e"></param> <param name="e"></param>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.DeviceProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.DeviceProperty">
<summary> <summary>
Gets or sets the <see cref="T:Artemis.Core.ArtemisDevice" /> to display Gets or sets the
<see cref="T:Artemis.Core.ArtemisDevice"/>
to display
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.Device"> <member name="P:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.Device">
<summary> <summary>
Gets or sets the <see cref="T:Artemis.Core.ArtemisDevice" /> to display Gets or sets the
<see cref="T:Artemis.Core.ArtemisDevice"/>
to display
</summary> </summary>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.ShowColorsProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.ShowColorsProperty">
<summary> <summary>
Gets or sets boolean indicating whether or not to show per-LED colors Gets or sets boolean indicating whether or not to show per-LED colors
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.ShowColors"> <member name="P:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.ShowColors">
@ -69,13 +85,13 @@
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnAttachedToLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnAttachedToLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnDetachedFromLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.OnDetachedFromLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.MeasureOverride(Avalonia.Size)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.DeviceVisualizer.MeasureOverride(Avalonia.Size)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.ValueProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.ValueProperty">
<summary> <summary>
@ -88,48 +104,62 @@
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.OnAttachedToLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.OnAttachedToLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.OnDetachedFromLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.EnumComboBox.OnDetachedFromLogicalTree(Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.ProfileConfigurationIcon.ConfigurationIconProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.ProfileConfigurationIcon.ConfigurationIconProperty">
<summary> <summary>
Gets or sets the <see cref="T:Artemis.Core.ProfileConfigurationIcon" /> to display Gets or sets the
<see cref="T:Artemis.Core.ProfileConfigurationIcon"/>
to display
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Controls.ProfileConfigurationIcon.ConfigurationIcon"> <member name="P:Artemis.UI.Avalonia.Shared.Controls.ProfileConfigurationIcon.ConfigurationIcon">
<summary> <summary>
Gets or sets the <see cref="T:Artemis.Core.ProfileConfigurationIcon" /> to display Gets or sets the
<see cref="T:Artemis.Core.ProfileConfigurationIcon"/>
to display
</summary> </summary>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle"> <member name="T:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle">
<summary> <summary>
Visualizes an <see cref="T:Artemis.Core.ArtemisDevice" /> with optional per-LED colors Visualizes an
<see cref="T:Artemis.Core.ArtemisDevice"/>
with optional per-LED colors
</summary> </summary>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BackgroundProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BackgroundProperty">
<summary> <summary>
Defines the <see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.Background" /> property. Defines the
<see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.Background"/>
property.
</summary> </summary>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrushProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrushProperty">
<summary> <summary>
Defines the <see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrush" /> property. Defines the
<see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrush"/>
property.
</summary> </summary>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderThicknessProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderThicknessProperty">
<summary> <summary>
Defines the <see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrush" /> property. Defines the
<see cref="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.BorderBrush"/>
property.
</summary> </summary>
</member> </member>
<member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.InputElementProperty"> <member name="F:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.InputElementProperty">
<summary> <summary>
Defines the <see cref="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.get_InputElement" /> property. Defines the
<see cref="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.get_InputElement"/>
property.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.#ctor"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.#ctor">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.Background"> <member name="P:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.Background">
<summary> <summary>
@ -147,36 +177,41 @@
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.OnAttachedToVisualTree(Avalonia.VisualTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.OnAttachedToVisualTree(Avalonia.VisualTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.OnDetachedFromVisualTree(Avalonia.VisualTreeAttachmentEventArgs)"> <member name="M:Artemis.UI.Avalonia.Shared.Controls.SelectionRectangle.OnDetachedFromVisualTree(Avalonia.VisualTreeAttachmentEventArgs)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter"> <member name="T:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter">
<summary> <summary>
Converts <see cref="T:Avalonia.Media.Color" /> into <see cref="T:SkiaSharp.SKColor" />. Converts
<see cref="T:Avalonia.Media.Color"/>
into<see cref="T:SkiaSharp.SKColor"/>.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter.Convert(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)"> <member name="M:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter.Convert(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter.ConvertBack(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)"> <member name="M:Artemis.UI.Avalonia.Shared.Converters.ColorToSKColorConverter.ConvertBack(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter"> <member name="T:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter">
<summary> <summary>
Converts <see cref="T:SkiaSharp.SKColor" /> into <see cref="T:Avalonia.Media.Color" />. Converts
<see cref="T:SkiaSharp.SKColor"/>
into<see cref="T:Avalonia.Media.Color"/>.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter.Convert(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)"> <member name="M:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter.Convert(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter.ConvertBack(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)"> <member name="M:Artemis.UI.Avalonia.Shared.Converters.SKColorToColorConverter.ConvertBack(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Events.DataModelInputDynamicEventArgs"> <member name="T:Artemis.UI.Avalonia.Shared.Events.DataModelInputDynamicEventArgs">
<summary> <summary>
Provides data about selection events raised by <see cref="!:DataModelDynamicViewModel" /> Provides data about selection events raised by
<see cref="!:DataModelDynamicViewModel"/>
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Events.DataModelInputDynamicEventArgs.DataModelPath"> <member name="P:Artemis.UI.Avalonia.Shared.Events.DataModelInputDynamicEventArgs.DataModelPath">
@ -186,7 +221,8 @@
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Events.DataModelInputStaticEventArgs"> <member name="T:Artemis.UI.Avalonia.Shared.Events.DataModelInputStaticEventArgs">
<summary> <summary>
Provides data about submit events raised by <see cref="!:DataModelStaticViewModel" /> Provides data about submit events raised by
<see cref="!:DataModelStaticViewModel"/>
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.Events.DataModelInputStaticEventArgs.Value"> <member name="P:Artemis.UI.Avalonia.Shared.Events.DataModelInputStaticEventArgs.Value">
@ -246,17 +282,19 @@
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Ninject.SharedUIModule"> <member name="T:Artemis.UI.Avalonia.Shared.Ninject.SharedUIModule">
<summary> <summary>
The main <see cref="T:Ninject.Modules.NinjectModule" /> of the Artemis Shared UI toolkit that binds all services The main
<see cref="T:Ninject.Modules.NinjectModule"/>
of the Artemis Shared UI toolkit that binds all services
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Ninject.SharedUIModule.Load"> <member name="M:Artemis.UI.Avalonia.Shared.Ninject.SharedUIModule.Load">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog`1"> <member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog`1">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog`1.Type"> <member name="P:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog`1.Type">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog"> <member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog">
<summary> <summary>
@ -264,7 +302,7 @@
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog.Type"> <member name="P:Artemis.UI.Avalonia.Shared.PluginConfigurationDialog.Type">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel"> <member name="T:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel">
<summary> <summary>
@ -273,7 +311,9 @@
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel.#ctor(Artemis.Core.Plugin)"> <member name="M:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel.#ctor(Artemis.Core.Plugin)">
<summary> <summary>
Creates a new instance of the <see cref="T:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel" /> class Creates a new instance of the
<see cref="T:Artemis.UI.Avalonia.Shared.PluginConfigurationViewModel"/>
class
</summary> </summary>
<param name="plugin"></param> <param name="plugin"></param>
</member> </member>
@ -294,7 +334,7 @@
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.FileDialogFilterBuilder"> <member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.FileDialogFilterBuilder">
<summary> <summary>
Represents a builder that can create a <see cref="T:Avalonia.Controls.FileDialogFilter" />. Represents a builder that can create a<see cref="T:Avalonia.Controls.FileDialogFilter"/>.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.FileDialogFilterBuilder.WithName(System.String)"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.FileDialogFilterBuilder.WithName(System.String)">
@ -314,7 +354,7 @@
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.OpenFileDialogBuilder"> <member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.OpenFileDialogBuilder">
<summary> <summary>
Represents a builder that can create a <see cref="T:Avalonia.Controls.OpenFileDialog" />. Represents a builder that can create a<see cref="T:Avalonia.Controls.OpenFileDialog"/>.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.OpenFileDialogBuilder.WithAllowMultiple"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.OpenFileDialogBuilder.WithAllowMultiple">
@ -353,7 +393,7 @@
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.SaveFileDialogBuilder"> <member name="T:Artemis.UI.Avalonia.Shared.Services.Builders.SaveFileDialogBuilder">
<summary> <summary>
Represents a builder that can create a <see cref="T:Avalonia.Controls.SaveFileDialog" />. Represents a builder that can create a<see cref="T:Avalonia.Controls.SaveFileDialog"/>.
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.SaveFileDialogBuilder.WithTitle(System.String)"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Builders.SaveFileDialogBuilder.WithTitle(System.String)">
@ -397,59 +437,74 @@
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowWindow``1(System.ValueTuple{System.String,System.Object}[])"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowWindow``1(System.ValueTuple{System.String,System.Object}[])">
<summary> <summary>
Creates a view model instance of type <typeparamref name="TViewModel" /> and shows its corresponding View as a window Creates a view model instance of type
<typeparamref name="TViewModel"/>
and shows its corresponding View as a window
</summary> </summary>
<typeparam name="TViewModel">The type of view model to create</typeparam> <typeparam name="TViewModel">The type of view model to create</typeparam>
<returns>The created view model</returns> <returns>The created view model</returns>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowWindow(System.Object)"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowWindow(System.Object)">
<summary> <summary>
Given a ViewModel, show its corresponding View as a window Given a ViewModel, show its corresponding View as a window
</summary> </summary>
<param name="viewModel">ViewModel to show the View for</param> <param name="viewModel">ViewModel to show the View for</param>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowExceptionDialog(System.String,System.Exception)"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowExceptionDialog(System.String,System.Exception)">
<summary> <summary>
Shows a dialog displaying the given exception Shows a dialog displaying the given exception
</summary> </summary>
<param name="title">The title of the dialog</param> <param name="title">The title of the dialog</param>
<param name="exception">The exception to display</param> <param name="exception">The exception to display</param>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowDialogAsync``1(Artemis.UI.Avalonia.Shared.DialogViewModelBase{``0})"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowDialogAsync``1(Artemis.UI.Avalonia.Shared.DialogViewModelBase{``0})">
<summary> <summary>
Given an existing ViewModel, show its corresponding View as a Dialog Given an existing ViewModel, show its corresponding View as a Dialog
</summary> </summary>
<typeparam name="TResult">The return type</typeparam> <typeparam name="TResult">The return type</typeparam>
<param name="viewModel">ViewModel to show the View for</param> <param name="viewModel">ViewModel to show the View for</param>
<returns>A task containing the return value of type <typeparamref name="TResult" /></returns> <returns>A task containing the return value of type
<typeparamref name="TResult"/>
</returns>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowDialogAsync``2(System.ValueTuple{System.String,System.Object}[])"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowDialogAsync``2(System.ValueTuple{System.String,System.Object}[])">
<summary> <summary>
Creates a view model instance of type <typeparamref name="TViewModel"/> and shows its corresponding View as a Dialog Creates a view model instance of type
<typeparamref name="TViewModel"/>
and shows its corresponding View as a Dialog
</summary> </summary>
<typeparam name="TViewModel">The view model type</typeparam> <typeparam name="TViewModel">The view model type</typeparam>
<typeparam name="TResult">The return type</typeparam> <typeparam name="TResult">The return type</typeparam>
<returns>A task containing the return value of type <typeparamref name="TResult" /></returns> <returns>A task containing the return value of type
<typeparamref name="TResult"/>
</returns>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowConfirmContentDialog(System.String,System.String,System.String,System.String)"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.ShowConfirmContentDialog(System.String,System.String,System.String,System.String)">
<summary> <summary>
Shows a content dialog asking the user to confirm an action Shows a content dialog asking the user to confirm an action
</summary> </summary>
<param name="title">The title of the dialog</param> <param name="title">The title of the dialog</param>
<param name="message">The message of the dialog</param> <param name="message">The message of the dialog</param>
<param name="confirm">The text of the confirm button</param> <param name="confirm">The text of the confirm button</param>
<param name="cancel">The text of the cancel button, if <see langword="null"/> the cancel button will not be shown</param> <param name="cancel">The text of the cancel button, if
<returns>A task containing the result of the dialog, <see langword="true"/> if confirmed; otherwise <see langword="false"/></returns> <see langword="null"/>
the cancel button will not be shown
</param>
<returns>A task containing the result of the dialog,
<see langword="true"/>
if confirmed; otherwise
<see langword="false"/>
</returns>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.CreateOpenFileDialog"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.CreateOpenFileDialog">
<summary> <summary>
Creates an open file dialog, use the fluent API to configure it Creates an open file dialog, use the fluent API to configure it
</summary> </summary>
<returns>The builder that can be used to configure the dialog</returns> <returns>The builder that can be used to configure the dialog</returns>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.CreateSaveFileDialog"> <member name="M:Artemis.UI.Avalonia.Shared.Services.Interfaces.IWindowService.CreateSaveFileDialog">
<summary> <summary>
Creates a save file dialog, use the fluent API to configure it Creates a save file dialog, use the fluent API to configure it
</summary> </summary>
<returns>The builder that can be used to configure the dialog</returns> <returns>The builder that can be used to configure the dialog</returns>
</member> </member>
@ -469,22 +524,24 @@
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.#ctor"> <member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.#ctor">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Dispose(System.Boolean)"> <member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Dispose(System.Boolean)">
<summary> <summary>
Releases the unmanaged resources used by the object and optionally releases the managed resources. Releases the unmanaged resources used by the object and optionally releases the managed resources.
</summary> </summary>
<param name="disposing"> <param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="true"/>
<see langword="false" /> to release only unmanaged resources. to release both managed and unmanaged resources;
<see langword="false"/>
to release only unmanaged resources.
</param> </param>
</member> </member>
<member name="P:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Activator"> <member name="P:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Activator">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Dispose"> <member name="M:Artemis.UI.Avalonia.Shared.ActivatableViewModelBase.Dispose">
<inheritdoc /> <inheritdoc/>
</member> </member>
<member name="T:Artemis.UI.Avalonia.Shared.DialogViewModelBase`1"> <member name="T:Artemis.UI.Avalonia.Shared.DialogViewModelBase`1">
<summary> <summary>
@ -493,7 +550,8 @@
</member> </member>
<member name="M:Artemis.UI.Avalonia.Shared.DialogViewModelBase`1.Close(`0)"> <member name="M:Artemis.UI.Avalonia.Shared.DialogViewModelBase`1.Close(`0)">
<summary> <summary>
Closes the dialog with the given <paramref name="result" /> Closes the dialog with the given
<paramref name="result"/>
</summary> </summary>
<param name="result">The result of the dialog</param> <param name="result">The result of the dialog</param>
</member> </member>

View File

@ -1,41 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ApplicationIcon /> <ApplicationIcon />
<StartupObject /> <StartupObject />
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DocumentationFile>bin\Artemis.UI.Avalonia.Shared.xml</DocumentationFile> <DocumentationFile>bin\Artemis.UI.Avalonia.Shared.xml</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Include="Avalonia.Diagnostics" Version="0.10.15" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" />
<PackageReference Include="DynamicData" Version="7.8.6" /> <PackageReference Include="DynamicData" Version="7.8.6" />
<PackageReference Include="FluentAvaloniaUI" Version="1.4.0" /> <PackageReference Include="FluentAvaloniaUI" Version="1.4.0" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.32" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.32" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Controls\HotkeyBox.axaml.cs"> <Compile Update="Controls\HotkeyBox.axaml.cs">
<DependentUpon>HotkeyBox.axaml</DependentUpon> <DependentUpon>HotkeyBox.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Services\Window\ExceptionDialogView.axaml.cs"> <Compile Update="Services\Window\ExceptionDialogView.axaml.cs">
<DependentUpon>%(Filename)</DependentUpon> <DependentUpon>%(Filename)</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Data; using Avalonia.Data;
@ -12,99 +11,60 @@ using FluentAvalonia.UI.Controls;
namespace Artemis.UI.Shared.Controls; namespace Artemis.UI.Shared.Controls;
public partial class DraggableNumberBox : UserControl /// <summary>
/// Represents a number box that can be mutated by dragging over it horizontally
/// </summary>
public class DraggableNumberBox : UserControl
{ {
/// <summary> /// <summary>
/// Gets or sets the value of the number box. /// Defines the <see cref="Value" /> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> ValueProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Value), defaultBindingMode: BindingMode.TwoWay); public static readonly StyledProperty<double> ValueProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Value), defaultBindingMode: BindingMode.TwoWay);
/// <summary> /// <summary>
/// Gets or sets the value of the number box. /// Defines the <see cref="Minimum" /> property.
/// </summary>
public double Value
{
get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
/// <summary>
/// Gets or sets the minimum of the number box.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MinimumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Minimum), double.MinValue); public static readonly StyledProperty<double> MinimumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Minimum), double.MinValue);
/// <summary> /// <summary>
/// Gets or sets the minimum of the number box. /// Defines the <see cref="Maximum" /> property.
/// </summary>
public double Minimum
{
get => GetValue(MinimumProperty);
set => SetValue(MinimumProperty, value);
}
/// <summary>
/// Gets or sets the maximum of the number box.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MaximumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Maximum), double.MaxValue); public static readonly StyledProperty<double> MaximumProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Maximum), double.MaxValue);
/// <summary> /// <summary>
/// Gets or sets the maximum of the number box. /// Defines the <see cref="LargeChange" /> property.
/// </summary> /// </summary>
public double Maximum
{
get => GetValue(MaximumProperty);
set => SetValue(MaximumProperty, value);
}
public static readonly StyledProperty<double> LargeChangeProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(LargeChange)); public static readonly StyledProperty<double> LargeChangeProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(LargeChange));
public double LargeChange /// <summary>
{ /// Defines the <see cref="SmallChange" /> property.
get => GetValue(LargeChangeProperty); /// </summary>
set => SetValue(LargeChangeProperty, value);
}
public static readonly StyledProperty<double> SmallChangeProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(SmallChange)); public static readonly StyledProperty<double> SmallChangeProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(SmallChange));
public double SmallChange /// <summary>
{ /// Defines the <see cref="SimpleNumberFormat" /> property.
get => GetValue(SmallChangeProperty); /// </summary>
set => SetValue(SmallChangeProperty, value);
}
public static readonly StyledProperty<string> SimpleNumberFormatProperty = AvaloniaProperty.Register<DraggableNumberBox, string>(nameof(SimpleNumberFormat)); public static readonly StyledProperty<string> SimpleNumberFormatProperty = AvaloniaProperty.Register<DraggableNumberBox, string>(nameof(SimpleNumberFormat));
public string SimpleNumberFormat /// <summary>
{ /// Defines the <see cref="Prefix" /> property.
get => GetValue(SimpleNumberFormatProperty); /// </summary>
set => SetValue(SimpleNumberFormatProperty, value); public static readonly StyledProperty<string?> PrefixProperty = AvaloniaProperty.Register<DraggableNumberBox, string?>(nameof(Prefix));
}
public static readonly StyledProperty<string> PrefixProperty = AvaloniaProperty.Register<DraggableNumberBox, string>(nameof(Prefix)); /// <summary>
/// Defines the <see cref="Suffix" /> property.
public string Prefix /// </summary>
{ public static readonly StyledProperty<string?> SuffixProperty = AvaloniaProperty.Register<DraggableNumberBox, string?>(nameof(Suffix));
get => GetValue(PrefixProperty);
set => SetValue(PrefixProperty, value);
}
public static readonly StyledProperty<string> SuffixProperty = AvaloniaProperty.Register<DraggableNumberBox, string>(nameof(Suffix));
public string Suffix
{
get => GetValue(SuffixProperty);
set => SetValue(SuffixProperty, value);
}
public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragStarted;
public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragFinished;
private readonly NumberBox _numberBox; private readonly NumberBox _numberBox;
private TextBox? _inputTextBox; private TextBox? _inputTextBox;
private bool _moved;
private double _lastX; private double _lastX;
private bool _moved;
private double _startX; private double _startX;
/// <summary>
/// Creates a new instance of the <see cref="DraggableNumberBox" /> class.
/// </summary>
public DraggableNumberBox() public DraggableNumberBox()
{ {
InitializeComponent(); InitializeComponent();
@ -117,6 +77,88 @@ public partial class DraggableNumberBox : UserControl
AddHandler(KeyUpEvent, HandleKeyUp, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true); AddHandler(KeyUpEvent, HandleKeyUp, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
} }
/// <summary>
/// Gets or sets the value of the number box.
/// </summary>
public double Value
{
get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
/// <summary>
/// Gets or sets the minimum of the number box.
/// </summary>
public double Minimum
{
get => GetValue(MinimumProperty);
set => SetValue(MinimumProperty, value);
}
/// <summary>
/// Gets or sets the maximum of the number box.
/// </summary>
public double Maximum
{
get => GetValue(MaximumProperty);
set => SetValue(MaximumProperty, value);
}
/// <summary>
/// Gets or sets the amount with which to increase/decrease the value when dragging.
/// </summary>
public double LargeChange
{
get => GetValue(LargeChangeProperty);
set => SetValue(LargeChangeProperty, value);
}
/// <summary>
/// Gets or sets the amount with which to increase/decrease the value when dragging and holding down shift.
/// </summary>
public double SmallChange
{
get => GetValue(SmallChangeProperty);
set => SetValue(SmallChangeProperty, value);
}
/// <summary>
/// Gets or sets the number format string used to format the value into a display value.
/// </summary>
public string SimpleNumberFormat
{
get => GetValue(SimpleNumberFormatProperty);
set => SetValue(SimpleNumberFormatProperty, value);
}
/// <summary>
/// Gets or sets the prefix to show before the value.
/// </summary>
public string? Prefix
{
get => GetValue(PrefixProperty);
set => SetValue(PrefixProperty, value);
}
/// <summary>
/// Gets or sets the affix to show behind the value.
/// </summary>
public string? Suffix
{
get => GetValue(SuffixProperty);
set => SetValue(SuffixProperty, value);
}
/// <summary>
/// Occurs when the user starts dragging over the control.
/// </summary>
public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragStarted;
/// <summary>
/// Occurs when the user finishes dragging over the control.
/// </summary>
public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragFinished;
private void HandleKeyUp(object? sender, KeyEventArgs e) private void HandleKeyUp(object? sender, KeyEventArgs e)
{ {
if (e.Key == Key.Enter || e.Key == Key.Escape) if (e.Key == Key.Enter || e.Key == Key.Escape)
@ -184,7 +226,9 @@ public partial class DraggableNumberBox : UserControl
private void OnPointerReleased(object? sender, PointerReleasedEventArgs e) private void OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{ {
if (!_moved) if (!_moved)
{
_inputTextBox?.Focus(); _inputTextBox?.Focus();
}
else else
{ {
_moved = false; _moved = false;

View File

@ -1,4 +1,5 @@
using Avalonia.Controls; using Artemis.UI.Shared.Controls.GradientPicker;
using Avalonia.Controls;
namespace Artemis.UI.Shared.Flyouts; namespace Artemis.UI.Shared.Flyouts;
@ -7,17 +8,17 @@ namespace Artemis.UI.Shared.Flyouts;
/// </summary> /// </summary>
public sealed class GradientPickerFlyout : Flyout public sealed class GradientPickerFlyout : Flyout
{ {
private GradientPicker.GradientPicker? _picker; private GradientPicker? _picker;
/// <summary> /// <summary>
/// Gets the gradient picker that this flyout hosts. /// Gets the gradient picker that this flyout hosts.
/// </summary> /// </summary>
public GradientPicker.GradientPicker GradientPicker => _picker ??= new GradientPicker.GradientPicker(); public GradientPicker GradientPicker => _picker ??= new GradientPicker();
/// <inheritdoc /> /// <inheritdoc />
protected override Control CreatePresenter() protected override Control CreatePresenter()
{ {
_picker ??= new GradientPicker.GradientPicker(); _picker ??= new GradientPicker();
FlyoutPresenter presenter = new() {Content = GradientPicker}; FlyoutPresenter presenter = new() {Content = GradientPicker};
return presenter; return presenter;
} }

View File

@ -16,7 +16,7 @@ using FluentAvalonia.UI.Media;
using ReactiveUI; using ReactiveUI;
using Button = Avalonia.Controls.Button; using Button = Avalonia.Controls.Button;
namespace Artemis.UI.Shared.GradientPicker; namespace Artemis.UI.Shared.Controls.GradientPicker;
/// <summary> /// <summary>
/// Represents a gradient picker that can be used to edit a gradient. /// Represents a gradient picker that can be used to edit a gradient.

View File

@ -13,7 +13,7 @@ using Avalonia.Media;
using FluentAvalonia.Core; using FluentAvalonia.Core;
using Button = FluentAvalonia.UI.Controls.Button; using Button = FluentAvalonia.UI.Controls.Button;
namespace Artemis.UI.Shared.GradientPicker; namespace Artemis.UI.Shared.Controls.GradientPicker;
/// <summary> /// <summary>
/// Represents a gradient picker box that can be used to edit a gradient /// Represents a gradient picker box that can be used to edit a gradient

View File

@ -5,9 +5,9 @@ using Avalonia.Controls;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Input; using Avalonia.Input;
namespace Artemis.UI.Shared.GradientPicker; namespace Artemis.UI.Shared.Controls.GradientPicker;
public class GradientPickerColorStop : TemplatedControl internal class GradientPickerColorStop : TemplatedControl
{ {
private static ColorGradientStop? _draggingStop; private static ColorGradientStop? _draggingStop;
private static IPointer? _dragPointer; private static IPointer? _dragPointer;

View File

@ -0,0 +1,23 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
namespace Artemis.UI.Shared.Converters;
/// <summary>
/// Converts any object to string by calling its ToString implementation, seems Avalonia doesn't do this
/// </summary>
public class ToStringConverter : IValueConverter
{
/// <inheritdoc />
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value?.ToString();
}
/// <inheritdoc />
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value;
}
}

View File

@ -1,11 +1,18 @@
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using SkiaSharp;
namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display
{ {
/// <summary>
/// Represents a data model display view used to display <see cref="SKColor" /> values.
/// </summary>
public partial class SKColorDataModelDisplayView : UserControl public partial class SKColorDataModelDisplayView : UserControl
{ {
/// <summary>
/// Creates a new instance of the <see cref="SKColorDataModelDisplayView"/> class.
/// </summary>
public SKColorDataModelDisplayView() public SKColorDataModelDisplayView()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Avalonia;
namespace Artemis.UI.Shared.Extensions
{
public static class PointExtensions
{
public static Point Empty = new(0, 0);
}
}

View File

@ -3,8 +3,16 @@ using SkiaSharp;
namespace Artemis.UI.Shared.Extensions; namespace Artemis.UI.Shared.Extensions;
/// <summary>
/// Provides utility methods when working with SkiaSharp matrices.
/// </summary>
public static class SKMatrixExtensions public static class SKMatrixExtensions
{ {
/// <summary>
/// Converts the matrix to an Avalonia <see cref="Matrix" />.
/// </summary>
/// <param name="matrix">The matrix to convert.</param>
/// <returns>The resulting Avalonia <see cref="Matrix" />.</returns>
public static Matrix ToMatrix(this SKMatrix matrix) public static Matrix ToMatrix(this SKMatrix matrix)
{ {
return new Matrix( return new Matrix(

View File

@ -3,13 +3,26 @@ using SkiaSharp;
namespace Artemis.UI.Shared.Extensions; namespace Artemis.UI.Shared.Extensions;
/// <summary>
/// Provides utility methods when working with SkiaSharp rectangles.
/// </summary>
public static class SKRectExtensions public static class SKRectExtensions
{ {
/// <summary>
/// Converts the rectangle to an Avalonia <see cref="Rect" />.
/// </summary>
/// <param name="rect">The rectangle to convert.</param>
/// <returns>The resulting Avalonia <see cref="Rect" />.</returns>
public static Rect ToRect(this SKRect rect) public static Rect ToRect(this SKRect rect)
{ {
return new Rect(rect.Left, rect.Top, rect.Width, rect.Height); return new Rect(rect.Left, rect.Top, rect.Width, rect.Height);
} }
/// <summary>
/// Converts the integer rectangle to an Avalonia <see cref="Rect" />.
/// </summary>
/// <param name="rect">The integer rectangle to convert.</param>
/// <returns>The resulting Avalonia <see cref="Rect" />.</returns>
public static Rect ToRect(this SKRectI rect) public static Rect ToRect(this SKRectI rect)
{ {
return new Rect(rect.Left, rect.Top, rect.Width, rect.Height); return new Rect(rect.Left, rect.Top, rect.Width, rect.Height);

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Controls; using Avalonia.Controls;
@ -65,6 +66,8 @@ namespace Artemis.UI.Shared.Services.Builders
{ {
FileDialogFilterBuilder builder = new(); FileDialogFilterBuilder builder = new();
configure(builder); configure(builder);
_openFileDialog.Filters ??= new List<FileDialogFilter>();
_openFileDialog.Filters.Add(builder.Build()); _openFileDialog.Filters.Add(builder.Build());
return this; return this;

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Controls; using Avalonia.Controls;
@ -65,6 +66,8 @@ namespace Artemis.UI.Shared.Services.Builders
{ {
FileDialogFilterBuilder builder = new(); FileDialogFilterBuilder builder = new();
configure(builder); configure(builder);
_saveFileDialog.Filters ??= new List<FileDialogFilter>();
_saveFileDialog.Filters.Add(builder.Build()); _saveFileDialog.Filters.Add(builder.Build());
return this; return this;

View File

@ -1,9 +0,0 @@
namespace Artemis.UI.Shared.Services;
public class GradientPickerService : IGradientPickerService
{
}
public interface IGradientPickerService : IArtemisSharedUIService
{
}

View File

@ -4,6 +4,9 @@ using Artemis.UI.Shared.Services.ProfileEditor;
namespace Artemis.UI.Shared.Services.NodeEditor; namespace Artemis.UI.Shared.Services.NodeEditor;
/// <summary>
/// Represents a service that can be used to execute editor commands on node scripts.
/// </summary>
public interface INodeEditorService : IArtemisSharedUIService public interface INodeEditorService : IArtemisSharedUIService
{ {
/// <summary> /// <summary>

View File

@ -9,6 +9,9 @@ using ReactiveUI;
namespace Artemis.UI.Shared.Services.NodeEditor; namespace Artemis.UI.Shared.Services.NodeEditor;
/// <summary>
/// Represents the command history of a node script.
/// </summary>
public class NodeEditorHistory public class NodeEditorHistory
{ {
private readonly Subject<bool> _canRedo = new(); private readonly Subject<bool> _canRedo = new();
@ -16,6 +19,10 @@ public class NodeEditorHistory
private readonly Stack<INodeEditorCommand> _redoCommands = new(); private readonly Stack<INodeEditorCommand> _redoCommands = new();
private readonly Stack<INodeEditorCommand> _undoCommands = new(); private readonly Stack<INodeEditorCommand> _undoCommands = new();
/// <summary>
/// Creates a new instance of the <see cref="NodeEditorHistory" /> class.
/// </summary>
/// <param name="nodeScript">The node script the history relates to.</param>
public NodeEditorHistory(INodeScript nodeScript) public NodeEditorHistory(INodeScript nodeScript)
{ {
NodeScript = nodeScript; NodeScript = nodeScript;
@ -25,14 +32,39 @@ public class NodeEditorHistory
Redo = ReactiveCommand.Create(ExecuteRedo, CanRedo); Redo = ReactiveCommand.Create(ExecuteRedo, CanRedo);
} }
/// <summary>
/// Gets the node script the history relates to.
/// </summary>
public INodeScript NodeScript { get; } public INodeScript NodeScript { get; }
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be undone.
/// </summary>
public IObservable<bool> CanUndo => _canUndo.AsObservable().DistinctUntilChanged(); public IObservable<bool> CanUndo => _canUndo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be redone.
/// </summary>
public IObservable<bool> CanRedo => _canRedo.AsObservable().DistinctUntilChanged(); public IObservable<bool> CanRedo => _canRedo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets a reactive command that can be executed to execute an instance of a <see cref="INodeEditorCommand" /> and puts it in history.
/// </summary>
public ReactiveCommand<INodeEditorCommand, Unit> Execute { get; } public ReactiveCommand<INodeEditorCommand, Unit> Execute { get; }
/// <summary>
/// Gets a reactive command that can be executed to undo history.
/// </summary>
public ReactiveCommand<Unit, INodeEditorCommand?> Undo { get; } public ReactiveCommand<Unit, INodeEditorCommand?> Undo { get; }
/// <summary>
/// Gets a reactive command that can be executed to redo history.
/// </summary>
public ReactiveCommand<Unit, INodeEditorCommand?> Redo { get; } public ReactiveCommand<Unit, INodeEditorCommand?> Redo { get; }
/// <summary>
/// Clears the history.
/// </summary>
public void Clear() public void Clear()
{ {
ClearRedo(); ClearRedo();
@ -40,6 +72,10 @@ public class NodeEditorHistory
UpdateSubjects(); UpdateSubjects();
} }
/// <summary>
/// Executes the provided <paramref name="command" /> and puts it in history.
/// </summary>
/// <param name="command">The command to execute</param>
public void ExecuteEditorCommand(INodeEditorCommand command) public void ExecuteEditorCommand(INodeEditorCommand command)
{ {
command.Execute(); command.Execute();

View File

@ -9,6 +9,9 @@ using ReactiveUI;
namespace Artemis.UI.Shared.Services.ProfileEditor; namespace Artemis.UI.Shared.Services.ProfileEditor;
/// <summary>
/// Represents the command history of a profile configuration.
/// </summary>
public class ProfileEditorHistory public class ProfileEditorHistory
{ {
private readonly Subject<bool> _canRedo = new(); private readonly Subject<bool> _canRedo = new();
@ -16,6 +19,10 @@ public class ProfileEditorHistory
private readonly Stack<IProfileEditorCommand> _redoCommands = new(); private readonly Stack<IProfileEditorCommand> _redoCommands = new();
private readonly Stack<IProfileEditorCommand> _undoCommands = new(); private readonly Stack<IProfileEditorCommand> _undoCommands = new();
/// <summary>
/// Creates a new instance of the <see cref="ProfileEditorHistory" /> class.
/// </summary>
/// <param name="profileConfiguration">The profile configuration the history relates to.</param>
public ProfileEditorHistory(ProfileConfiguration profileConfiguration) public ProfileEditorHistory(ProfileConfiguration profileConfiguration)
{ {
ProfileConfiguration = profileConfiguration; ProfileConfiguration = profileConfiguration;
@ -25,14 +32,39 @@ public class ProfileEditorHistory
Redo = ReactiveCommand.Create(ExecuteRedo, CanRedo); Redo = ReactiveCommand.Create(ExecuteRedo, CanRedo);
} }
/// <summary>
/// Gets the profile configuration the history relates to.
/// </summary>
public ProfileConfiguration ProfileConfiguration { get; } public ProfileConfiguration ProfileConfiguration { get; }
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be undone.
/// </summary>
public IObservable<bool> CanUndo => _canUndo.AsObservable().DistinctUntilChanged(); public IObservable<bool> CanUndo => _canUndo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be redone.
/// </summary>
public IObservable<bool> CanRedo => _canRedo.AsObservable().DistinctUntilChanged(); public IObservable<bool> CanRedo => _canRedo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets a reactive command that can be executed to execute an instance of a <see cref="IProfileEditorCommand" /> and puts it in history.
/// </summary>
public ReactiveCommand<IProfileEditorCommand, Unit> Execute { get; } public ReactiveCommand<IProfileEditorCommand, Unit> Execute { get; }
/// <summary>
/// Gets a reactive command that can be executed to undo history.
/// </summary>
public ReactiveCommand<Unit, IProfileEditorCommand?> Undo { get; } public ReactiveCommand<Unit, IProfileEditorCommand?> Undo { get; }
/// <summary>
/// Gets a reactive command that can be executed to redo history.
/// </summary>
public ReactiveCommand<Unit, IProfileEditorCommand?> Redo { get; } public ReactiveCommand<Unit, IProfileEditorCommand?> Redo { get; }
/// <summary>
/// Clears the history.
/// </summary>
public void Clear() public void Clear()
{ {
ClearRedo(); ClearRedo();
@ -40,6 +72,10 @@ public class ProfileEditorHistory
UpdateSubjects(); UpdateSubjects();
} }
/// <summary>
/// Executes the provided <paramref name="command" /> and puts it in history.
/// </summary>
/// <param name="command">The command to execute</param>
public void ExecuteEditorCommand(IProfileEditorCommand command) public void ExecuteEditorCommand(IProfileEditorCommand command)
{ {
command.Execute(); command.Execute();
@ -52,8 +88,10 @@ public class ProfileEditorHistory
private void ClearRedo() private void ClearRedo()
{ {
foreach (IProfileEditorCommand profileEditorCommand in _redoCommands) foreach (IProfileEditorCommand profileEditorCommand in _redoCommands)
{
if (profileEditorCommand is IDisposable disposable) if (profileEditorCommand is IDisposable disposable)
disposable.Dispose(); disposable.Dispose();
}
_redoCommands.Clear(); _redoCommands.Clear();
} }
@ -61,8 +99,10 @@ public class ProfileEditorHistory
private void ClearUndo() private void ClearUndo()
{ {
foreach (IProfileEditorCommand profileEditorCommand in _undoCommands) foreach (IProfileEditorCommand profileEditorCommand in _undoCommands)
{
if (profileEditorCommand is IDisposable disposable) if (profileEditorCommand is IDisposable disposable)
disposable.Dispose(); disposable.Dispose();
}
_undoCommands.Clear(); _undoCommands.Clear();
} }

View File

@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using System.Reactive.Linq; using System.Reactive.Linq;
using Artemis.Core; using Artemis.Core;
using Artemis.UI.Shared.Controls;
using Artemis.UI.Shared.Services.ProfileEditor; using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands; using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia.Threading; using Avalonia.Threading;
@ -79,7 +80,7 @@ public abstract class PropertyInputViewModel<T> : PropertyInputViewModel
/// <summary> /// <summary>
/// Gets or boolean indicating whether the current input is being previewed, the value won't be applied until /// Gets or boolean indicating whether the current input is being previewed, the value won't be applied until
/// <para> /// <para>
/// Only applicable when using something like a <see cref="DraggableFloat" />, see /// Only applicable when using something like a <see cref="DraggableNumberBox" />, see
/// <see cref="StartPreview" /> and <see cref="ApplyPreview" /> /// <see cref="StartPreview" /> and <see cref="ApplyPreview" />
/// </para> /// </para>
/// </summary> /// </summary>

View File

@ -1,10 +1,10 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker"
xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker" xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker"
xmlns:controls1="clr-namespace:Artemis.UI.Shared" xmlns:controls1="clr-namespace:Artemis.UI.Shared"
xmlns:controls2="clr-namespace:Artemis.UI.Shared.Controls"> xmlns:controls2="clr-namespace:Artemis.UI.Shared.Controls"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="50"> <Border Padding="50">
<StackPanel Spacing="5"> <StackPanel Spacing="5">

View File

@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker" xmlns:dataModelPicker="clr-namespace:Artemis.UI.Shared.DataModelPicker"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker"> xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20" Width="200"> <Border Padding="20" Width="200">
<StackPanel Spacing="5"> <StackPanel Spacing="5">

View File

@ -4,7 +4,7 @@
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core" xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:fluent="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters" xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker"> xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker">
<Styles.Resources> <Styles.Resources>
<VisualBrush x:Key="LightCheckerboardBrush" TileMode="Tile" Stretch="Uniform" DestinationRect="3,0,10,10"> <VisualBrush x:Key="LightCheckerboardBrush" TileMode="Tile" Stretch="Uniform" DestinationRect="3,0,10,10">
<VisualBrush.Visual> <VisualBrush.Visual>

View File

@ -1,7 +1,7 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker"> xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20" Width="200"> <Border Padding="20" Width="200">
<StackPanel Spacing="5"> <StackPanel Spacing="5">

View File

@ -5,7 +5,7 @@
--> -->
<configuration> <configuration>
<packageSources> <packageSources>
<add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2" /> <add key="AvaloniaCI" value="https://www.myget.org/F/avalonia-ci/api/v2"/>
</packageSources> </packageSources>
</configuration> </configuration>

View File

@ -1,42 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**"/>
<None Remove=".gitignore" /> <None Remove=".gitignore"/>
<None Remove="Assets\Cursors\aero_crosshair.cur" /> <None Remove="Assets\Cursors\aero_crosshair.cur"/>
<None Remove="Assets\Cursors\aero_crosshair_minus.cur" /> <None Remove="Assets\Cursors\aero_crosshair_minus.cur"/>
<None Remove="Assets\Cursors\aero_crosshair_plus.cur" /> <None Remove="Assets\Cursors\aero_crosshair_plus.cur"/>
<None Remove="Assets\Cursors\aero_drag.cur" /> <None Remove="Assets\Cursors\aero_drag.cur"/>
<None Remove="Assets\Cursors\aero_drag_ew.cur" /> <None Remove="Assets\Cursors\aero_drag_ew.cur"/>
<None Remove="Assets\Cursors\aero_fill.cur" /> <None Remove="Assets\Cursors\aero_fill.cur"/>
<None Remove="Assets\Cursors\aero_pen_min.cur" /> <None Remove="Assets\Cursors\aero_pen_min.cur"/>
<None Remove="Assets\Cursors\aero_pen_plus.cur" /> <None Remove="Assets\Cursors\aero_pen_plus.cur"/>
<None Remove="Assets\Cursors\aero_rotate.cur" /> <None Remove="Assets\Cursors\aero_rotate.cur"/>
<None Remove="Assets\Cursors\aero_rotate_bl.cur" /> <None Remove="Assets\Cursors\aero_rotate_bl.cur"/>
<None Remove="Assets\Cursors\aero_rotate_br.cur" /> <None Remove="Assets\Cursors\aero_rotate_br.cur"/>
<None Remove="Assets\Cursors\aero_rotate_tl.cur" /> <None Remove="Assets\Cursors\aero_rotate_tl.cur"/>
<None Remove="Assets\Cursors\aero_rotate_tr.cur" /> <None Remove="Assets\Cursors\aero_rotate_tr.cur"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15"/>
<PackageReference Include="Avalonia.Desktop" Version="0.10.15" /> <PackageReference Include="Avalonia.Desktop" Version="0.10.15"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.15"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15"/>
<PackageReference Include="Avalonia.Win32" Version="0.10.15" /> <PackageReference Include="Avalonia.Win32" Version="0.10.15"/>
<PackageReference Include="Microsoft.Win32" Version="2.0.1" /> <PackageReference Include="Microsoft.Win32" Version="2.0.1"/>
<PackageReference Include="RawInput.Sharp" Version="0.0.4" /> <PackageReference Include="RawInput.Sharp" Version="0.0.4"/>
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50"/>
<PackageReference Include="SkiaSharp.Vulkan.SharpVk" Version="2.88.1-preview.1" /> <PackageReference Include="SkiaSharp.Vulkan.SharpVk" Version="2.88.1-preview.1"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj"/>
<ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj" /> <ProjectReference Include="..\Artemis.UI\Artemis.UI.csproj"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,6 @@
using System; #nullable disable
using System;
using SharpVk; using SharpVk;
using SharpVk.Khronos; using SharpVk.Khronos;
using SkiaSharp; using SkiaSharp;

View File

@ -1,80 +1,80 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Artemis.UI.Avalonia.csproj.DotSettings" /> <None Remove="Artemis.UI.Avalonia.csproj.DotSettings" />
<None Remove="Artemis.UI.csproj.DotSettings" /> <None Remove="Artemis.UI.csproj.DotSettings" />
<None Remove="Assets\Images\Logo\application.ico" /> <None Remove="Assets\Images\Logo\application.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="10.14.0" /> <PackageReference Include="Avalonia.Controls.PanAndZoom" Version="10.14.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.15" /> <PackageReference Include="Avalonia.Desktop" Version="0.10.15" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Include="Avalonia.Diagnostics" Version="0.10.15" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" />
<PackageReference Include="DynamicData" Version="7.8.6" /> <PackageReference Include="DynamicData" Version="7.8.6" />
<PackageReference Include="FluentAvaloniaUI" Version="1.4.0" /> <PackageReference Include="FluentAvaloniaUI" Version="1.4.0" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Live.Avalonia" Version="1.3.1" /> <PackageReference Include="Live.Avalonia" Version="1.3.1" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.32" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.32" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.32" /> <PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.32" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" />
<PackageReference Include="Splat.Ninject" Version="14.1.45" /> <PackageReference Include="Splat.Ninject" Version="14.1.45" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
<ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj" /> <ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj" />
<ProjectReference Include="..\Artemis.VisualScripting\Artemis.VisualScripting.csproj" /> <ProjectReference Include="..\Artemis.VisualScripting\Artemis.VisualScripting.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Assets\Images\Logo\bow-white.ico" /> <Content Include="Assets\Images\Logo\bow-white.ico" />
<Content Include="Assets\Images\Logo\bow.ico" /> <Content Include="Assets\Images\Logo\bow.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Assets\Images\Logo\bow-black.ico" /> <Resource Include="Assets\Images\Logo\bow-black.ico" />
<Resource Include="Assets\Images\Logo\bow-white.ico" /> <Resource Include="Assets\Images\Logo\bow-white.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="DefaultTypes\PropertyInput\StringPropertyInputView.axaml.cs"> <Compile Update="DefaultTypes\PropertyInput\StringPropertyInputView.axaml.cs">
<DependentUpon>StringPropertyInputView.xaml</DependentUpon> <DependentUpon>StringPropertyInputView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Screens\ProfileEditor\Panels\Properties\PropertiesView.axaml.cs"> <Compile Update="Screens\ProfileEditor\Panels\Properties\PropertiesView.axaml.cs">
<DependentUpon>PropertiesView.axaml</DependentUpon> <DependentUpon>PropertiesView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Screens\ProfileEditor\Panels\VisualEditor\Visualizers\LayerShapeVisualizerView.axaml.cs"> <Compile Update="Screens\ProfileEditor\Panels\VisualEditor\Visualizers\LayerShapeVisualizerView.axaml.cs">
<DependentUpon>LayerShapeVisualizerView.axaml</DependentUpon> <DependentUpon>LayerShapeVisualizerView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Screens\VisualScripting\DragCableView.axaml.cs"> <Compile Update="Screens\VisualScripting\DragCableView.axaml.cs">
<DependentUpon>DragCableView.axaml</DependentUpon> <DependentUpon>DragCableView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Screens\VisualScripting\NodeScriptWindowView.axaml.cs"> <Compile Update="Screens\VisualScripting\NodeScriptWindowView.axaml.cs">
<DependentUpon>NodeScriptWindowView.axaml</DependentUpon> <DependentUpon>NodeScriptWindowView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Screens\ProfileEditor\Panels\Properties\Tree\ContentDialogs\LayerEffectRenameView.axaml.cs"> <Compile Update="Screens\ProfileEditor\Panels\Properties\Tree\ContentDialogs\LayerEffectRenameView.axaml.cs">
<DependentUpon>LayerEffectRenameView.axaml</DependentUpon> <DependentUpon>LayerEffectRenameView.axaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Update="Screens\ProfileEditor\Panels\Properties\Tree\ContentDialogs\SidebarCategoryEditView.axaml.cs"> <Compile Update="Screens\ProfileEditor\Panels\Properties\Tree\ContentDialogs\SidebarCategoryEditView.axaml.cs">
<DependentUpon>SidebarCategoryEditView.axaml</DependentUpon> <DependentUpon>SidebarCategoryEditView.axaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AvaloniaXaml Update="DefaultTypes\PropertyInput\StringPropertyInputView.axaml"> <AvaloniaXaml Update="DefaultTypes\PropertyInput\StringPropertyInputView.axaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</AvaloniaXaml> </AvaloniaXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput" xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker;assembly=Artemis.UI.Shared" xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.DefaultTypes.PropertyInput.ColorGradientPropertyInputView" x:Class="Artemis.UI.DefaultTypes.PropertyInput.ColorGradientPropertyInputView"
x:DataType="propertyInput:ColorGradientPropertyInputViewModel"> x:DataType="propertyInput:ColorGradientPropertyInputViewModel">

View File

@ -1,5 +1,5 @@
using System; using System;
using Artemis.UI.Shared.GradientPicker; using Artemis.UI.Shared.Controls.GradientPicker;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI; using Avalonia.ReactiveUI;

View File

@ -51,19 +51,12 @@
<GridSplitter Grid.Column="1" Width="15" Margin="-15 0 0 0" Background="Transparent" HorizontalAlignment="Stretch" /> <GridSplitter Grid.Column="1" Width="15" Margin="-15 0 0 0" Background="Transparent" HorizontalAlignment="Stretch" />
<Border Grid.Column="2" Classes="card-condensed" CornerRadius="10 0 0 0" Margin="0 10 0 0" Background="#ff323232"> <Border Grid.Column="2" Classes="card-condensed" CornerRadius="10 0 0 0" Margin="0 10 0 0" Background="#ff323232">
<TabControl Items="{CompiledBinding Tabs}"> <TabControl Items="{CompiledBinding Tabs}" Padding="12">
<TabControl.ItemTemplate> <TabControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{CompiledBinding DisplayName}" /> <TextBlock Text="{CompiledBinding DisplayName}" />
</DataTemplate> </DataTemplate>
</TabControl.ItemTemplate> </TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ContentControl Content="{Binding}" Margin="0 12" />
</ScrollViewer>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl> </TabControl>
</Border> </Border>

View File

@ -5,81 +5,84 @@
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.DeviceInfoTabView"> x:Class="Artemis.UI.Screens.Device.DeviceInfoTabView">
<Grid RowDefinitions="Auto,*" ColumnDefinitions="*,*" Margin="-5"> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<!-- First row --> <Grid RowDefinitions="Auto,*" ColumnDefinitions="*,*" Margin="-5">
<Border Classes="card" Grid.Column="0" Grid.Row="0" Margin="5"> <!-- First row -->
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Top"> <Border Classes="card" Grid.Column="0" Grid.Row="0" Margin="5">
<TextBlock FontWeight="Bold">Device name</TextBlock> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
<TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.DeviceInfo.DeviceName}" /> <TextBlock FontWeight="Bold">Device name</TextBlock>
<Separator Classes="card-separator" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.DeviceInfo.DeviceName}" />
<Separator Classes="card-separator" />
<TextBlock FontWeight="Bold">Manufacturer</TextBlock> <TextBlock FontWeight="Bold">Manufacturer</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.DeviceInfo.Manufacturer}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.DeviceInfo.Manufacturer}" />
<Separator Classes="card-separator" /> <Separator Classes="card-separator" />
<TextBlock FontWeight="Bold">Device type</TextBlock> <TextBlock FontWeight="Bold">Device type</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.DeviceType}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.DeviceType}" />
<Separator Classes="card-separator" IsVisible="{Binding IsKeyboard}" /> <Separator Classes="card-separator" IsVisible="{Binding IsKeyboard}" />
<StackPanel IsVisible="{Binding IsKeyboard}"> <StackPanel IsVisible="{Binding IsKeyboard}">
<TextBlock FontWeight="Bold">Physical layout</TextBlock> <TextBlock FontWeight="Bold">Physical layout</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.PhysicalLayout}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.PhysicalLayout}" />
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </Border>
</Border>
<Border Classes="card" Grid.Row="0" Grid.Column="1" Margin="5"> <Border Classes="card" Grid.Row="0" Grid.Column="1" Margin="5">
<StackPanel VerticalAlignment="Top"> <StackPanel VerticalAlignment="Top">
<TextBlock FontWeight="Bold">Size (1px = 1mm)</TextBlock> <TextBlock FontWeight="Bold">Size (1px = 1mm)</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Size}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Size}" />
<Separator Classes="card-separator" /> <Separator Classes="card-separator" />
<TextBlock FontWeight="Bold">Location (1px = 1mm)</TextBlock> <TextBlock FontWeight="Bold">Location (1px = 1mm)</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Location}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Location}" />
<Separator Classes="card-separator" /> <Separator Classes="card-separator" />
<TextBlock FontWeight="Bold">Rotation (degrees)</TextBlock> <TextBlock FontWeight="Bold">Rotation (degrees)</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Rotation.Degrees}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.RgbDevice.Rotation.Degrees}" />
<Separator Classes="card-separator" IsVisible="{Binding IsKeyboard}" /> <Separator Classes="card-separator" IsVisible="{Binding IsKeyboard}" />
<StackPanel IsVisible="{Binding IsKeyboard}"> <StackPanel IsVisible="{Binding IsKeyboard}">
<TextBlock FontWeight="Bold">Logical layout</TextBlock> <TextBlock FontWeight="Bold">Logical layout</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.LogicalLayout}" /> <TextBlock TextWrapping="Wrap" Text="{Binding Device.LogicalLayout}" />
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </Border>
</Border>
<!-- Second row --> <!-- Second row -->
<Border Classes="card" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="5"> <Border Classes="card" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="5">
<StackPanel> <StackPanel>
<Grid ColumnDefinitions="*,Auto"> <Grid ColumnDefinitions="*,Auto">
<TextBlock FontWeight="Bold">Default layout file path</TextBlock> <TextBlock FontWeight="Bold">Default layout file path</TextBlock>
<Button Grid.Column="1" <Button Grid.Column="1"
Classes="icon-button" Classes="icon-button"
ToolTip.Tip="Copy path to clipboard" ToolTip.Tip="Copy path to clipboard"
Command="{Binding CopyToClipboard}" Command="{Binding CopyToClipboard}"
CommandParameter="{Binding DefaultLayoutPath}"> CommandParameter="{Binding DefaultLayoutPath}">
<avalonia:MaterialIcon Kind="ContentCopy" Width="18" Height="18" /> <avalonia:MaterialIcon Kind="ContentCopy" Width="18" Height="18" />
</Button> </Button>
</Grid> </Grid>
<TextBlock <TextBlock
TextWrapping="Wrap" TextWrapping="Wrap"
Text="{Binding DefaultLayoutPath}" /> Text="{Binding DefaultLayoutPath}" />
<Separator Classes="card-separator" /> <Separator Classes="card-separator" />
<Grid ColumnDefinitions="*,Auto">
<TextBlock FontWeight="Bold">Image file path</TextBlock>
<Button Grid.Column="1"
Classes="icon-button"
ToolTip.Tip="Copy path to clipboard"
Command="{Binding CopyToClipboard}"
CommandParameter="{Binding Device.Layout.Image.LocalPath}">
<avalonia:MaterialIcon Kind="ContentCopy" Width="18" Height="18" />
</Button>
</Grid>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.Layout.Image.LocalPath}" />
</StackPanel>
</Border>
</Grid>
</ScrollViewer>
<Grid ColumnDefinitions="*,Auto">
<TextBlock FontWeight="Bold">Image file path</TextBlock>
<Button Grid.Column="1"
Classes="icon-button"
ToolTip.Tip="Copy path to clipboard"
Command="{Binding CopyToClipboard}"
CommandParameter="{Binding Device.Layout.Image.LocalPath}">
<avalonia:MaterialIcon Kind="ContentCopy" Width="18" Height="18" />
</Button>
</Grid>
<TextBlock TextWrapping="Wrap" Text="{Binding Device.Layout.Image.LocalPath}" />
</StackPanel>
</Border>
</Grid>
</UserControl> </UserControl>

View File

@ -0,0 +1,46 @@
using System.Collections.ObjectModel;
using Artemis.Core;
using Artemis.UI.Shared;
using RGB.NET.Core;
namespace Artemis.UI.Screens.Device;
public class DeviceLedsTabLedViewModel : ViewModelBase
{
private readonly ObservableCollection<ArtemisLed> _selectedLeds;
private bool _isSelected;
public DeviceLedsTabLedViewModel(ArtemisLed artemisLed, ObservableCollection<ArtemisLed> selectedLeds)
{
_selectedLeds = selectedLeds;
ArtemisLed = artemisLed;
Update();
}
public ArtemisLed ArtemisLed { get; }
public bool IsSelected
{
get => _isSelected;
set
{
if (!RaiseAndSetIfChanged(ref _isSelected, value))
return;
Apply();
}
}
public void Update()
{
IsSelected = _selectedLeds.Contains(ArtemisLed);
}
public void Apply()
{
if (IsSelected && !_selectedLeds.Contains(ArtemisLed))
_selectedLeds.Add(ArtemisLed);
else if (!IsSelected && _selectedLeds.Contains(ArtemisLed))
_selectedLeds.Remove(ArtemisLed);
}
}

View File

@ -2,7 +2,27 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:device="clr-namespace:Artemis.UI.Screens.Device"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
xmlns:shared="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.DeviceLedsTabView"> x:Class="Artemis.UI.Screens.Device.DeviceLedsTabView"
Welcome to Avalonia! x:DataType="device:DeviceLedsTabViewModel">
<UserControl.Resources>
<converters:UriToFileNameConverter x:Key="UriToFileNameConverter" />
<converters:LedIdToStringConverter x:Key="LedIdToStringConverter" />
<shared:ToStringConverter x:Key="ToStringConverter" />
</UserControl.Resources>
<DataGrid Items="{CompiledBinding LedViewModels}" CanUserSortColumns="True" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{Binding IsSelected, Mode=TwoWay}" CanUserSort="False" CanUserReorder="False" Header="Highlight" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Id, Converter={StaticResource LedIdToStringConverter}, Mode=OneWay}" Header="LED ID" Width="Auto" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Color, Converter={StaticResource ToStringConverter}, Mode=OneWay}" Header="Color (ARGB)" Width="Auto" CanUserSort="False" />
<DataGridTextColumn Binding="{Binding ArtemisLed.Layout.Image, Converter={StaticResource UriToFileNameConverter}, Mode=OneWay}" Header="Image file" CanUserSort="False" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Shape}" Header="Shape" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Location, Converter={StaticResource ToStringConverter}, Mode=OneWay}" Header="Location" Width="Auto" CanUserSort="False" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Size, Converter={StaticResource ToStringConverter}, Mode=OneWay}" Header="Size" Width="Auto" CanUserSort="False" />
<DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.CustomData}" Header="LED data" Width="Auto" />
</DataGrid.Columns>
</DataGrid>
</UserControl> </UserControl>

View File

@ -39,44 +39,4 @@ namespace Artemis.UI.Screens.Device
deviceLedsTabLedViewModel.Update(); deviceLedsTabLedViewModel.Update();
} }
} }
public class DeviceLedsTabLedViewModel : ViewModelBase
{
private readonly ObservableCollection<ArtemisLed> _selectedLeds;
private bool _isSelected;
public DeviceLedsTabLedViewModel(ArtemisLed artemisLed, ObservableCollection<ArtemisLed> selectedLeds)
{
_selectedLeds = selectedLeds;
ArtemisLed = artemisLed;
Update();
}
public ArtemisLed ArtemisLed { get; }
public bool IsSelected
{
get => _isSelected;
set
{
if (!RaiseAndSetIfChanged(ref _isSelected, value))
return;
Apply();
}
}
public void Update()
{
IsSelected = _selectedLeds.Contains(ArtemisLed);
}
public void Apply()
{
if (IsSelected && !_selectedLeds.Contains(ArtemisLed))
_selectedLeds.Add(ArtemisLed);
else if (!IsSelected && _selectedLeds.Contains(ArtemisLed))
_selectedLeds.Remove(ArtemisLed);
}
}
} }

View File

@ -15,185 +15,187 @@
<device:DevicePropertiesTabViewModel /> <device:DevicePropertiesTabViewModel />
</Design.DataContext> </Design.DataContext>
<!-- Body --> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<Grid RowDefinitions="*,Auto"> <!-- Body -->
<StackPanel Grid.Row="0"> <Grid RowDefinitions="*,Auto">
<!-- Layout --> <StackPanel Grid.Row="0">
<TextBlock Classes="h4"> <!-- Layout -->
Categories <TextBlock Classes="h4">
</TextBlock> Categories
<TextBlock TextWrapping="Wrap"> </TextBlock>
Artemis uses categories to determine where the layers of imported profiles are applied to. <TextBlock TextWrapping="Wrap">
</TextBlock> Artemis uses categories to determine where the layers of imported profiles are applied to.
<TextBlock TextWrapping="Wrap"> </TextBlock>
You can hover over a category for a more detailed description. <TextBlock TextWrapping="Wrap">
</TextBlock> You can hover over a category for a more detailed description.
<StackPanel Orientation="Horizontal"> </TextBlock>
<CheckBox IsChecked="{Binding HasDeskCategory}" <StackPanel Orientation="Horizontal">
ToolTip.Tip="A device acting as desk ornamentation such as a LED strip" <CheckBox IsChecked="{Binding HasDeskCategory}"
Content="Desk" /> ToolTip.Tip="A device acting as desk ornamentation such as a LED strip"
<CheckBox IsChecked="{Binding HasMonitorCategory}" Content="Desk" />
ToolTip.Tip="A device attached to the monitor such as ambilight LEDs" <CheckBox IsChecked="{Binding HasMonitorCategory}"
Content="Monitor" /> ToolTip.Tip="A device attached to the monitor such as ambilight LEDs"
<CheckBox ToolTip.Tip="A device inside your computer case" Content="Monitor" />
IsChecked="{Binding HasCaseCategory}" <CheckBox ToolTip.Tip="A device inside your computer case"
Content="Case" /> IsChecked="{Binding HasCaseCategory}"
<CheckBox IsChecked="{Binding HasRoomCategory}" Content="Case" />
ToolTip.Tip="A device elsewhere in the room" <CheckBox IsChecked="{Binding HasRoomCategory}"
Content="Room" /> ToolTip.Tip="A device elsewhere in the room"
<CheckBox IsChecked="{Binding HasPeripheralsCategory}" Content="Room" />
ToolTip.Tip="A peripheral such as a mouse or keyboard" <CheckBox IsChecked="{Binding HasPeripheralsCategory}"
Content="Peripheral" /> ToolTip.Tip="A peripheral such as a mouse or keyboard"
</StackPanel> Content="Peripheral" />
</StackPanel>
<Grid Margin="0 25" ColumnDefinitions="*,40,*"> <Grid Margin="0 25" ColumnDefinitions="*,40,*">
<Grid Grid.Column="0" ColumnDefinitions="*,Auto,Auto" RowDefinitions="*,*,*,*,*"> <Grid Grid.Column="0" ColumnDefinitions="*,Auto,Auto" RowDefinitions="*,*,*,*,*">
<TextBlock Grid.Row="0" Grid.ColumnSpan="3" Classes="h4"> <TextBlock Grid.Row="0" Grid.ColumnSpan="3" Classes="h4">
Surface properties Surface properties
</TextBlock> </TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">X-coordinate</TextBlock> <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">X-coordinate</TextBlock>
<NumericUpDown Grid.Row="1" <NumericUpDown Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="10 0" Margin="10 0"
VerticalAlignment="Center" VerticalAlignment="Center"
Value="{Binding X}" /> Value="{Binding X}" />
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock> <TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Y-coordinate</TextBlock> <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Y-coordinate</TextBlock>
<NumericUpDown Grid.Row="2" <NumericUpDown Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Margin="10 0" Margin="10 0"
VerticalAlignment="Center" VerticalAlignment="Center"
Value="{Binding Y}" /> Value="{Binding Y}" />
<TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock> <TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center">mm</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Scale</TextBlock> <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Scale</TextBlock>
<NumericUpDown Grid.Row="3" <NumericUpDown Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="10 0" Margin="10 0"
VerticalAlignment="Center" VerticalAlignment="Center"
Value="{Binding Scale}" /> Value="{Binding Scale}" />
<TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">times</TextBlock> <TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">times</TextBlock>
<TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Rotation</TextBlock> <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Rotation</TextBlock>
<NumericUpDown Grid.Row="4" <NumericUpDown Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Margin="10 0" Margin="10 0"
VerticalAlignment="Center" VerticalAlignment="Center"
Value="{Binding Rotation}" /> Value="{Binding Rotation}" />
<TextBlock Grid.Row="4" Grid.Column="2" VerticalAlignment="Center">deg</TextBlock> <TextBlock Grid.Row="4" Grid.Column="2" VerticalAlignment="Center">deg</TextBlock>
</Grid>
<Rectangle Grid.Column="1" VerticalAlignment="Stretch" Width="1" Fill="{DynamicResource ButtonBorderBrush}" Margin="0 0 0 5" />
<StackPanel Grid.Column="2">
<TextBlock Classes="h4">
Color calibration
</TextBlock>
<TextBlock TextWrapping="Wrap">
Use the sliders below to adjust the colors of your device so that it matches your other devices.
</TextBlock>
<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="{Binding RedScale}" Margin="10 0" VerticalAlignment="Center" />
<NumericUpDown Grid.Row="0"
Grid.Column="2"
VerticalAlignment="Center"
Width="65"
Value="{Binding 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="{Binding GreenScale}" Margin="10 0" VerticalAlignment="Center" />
<NumericUpDown Grid.Row="1"
Grid.Column="2"
VerticalAlignment="Center"
Width="65"
Value="{Binding 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="{Binding BlueScale}" Margin="10 0" Ticks="100" VerticalAlignment="Center" />
<NumericUpDown Grid.Row="2"
Grid.Column="2"
VerticalAlignment="Center"
Width="65"
Value="{Binding BlueScale}"
ShowButtonSpinner="False"
FormatString="{}{0:0.0}"
Minimum="0"
Maximum="200"
ClipValueToMinMax="True" />
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding DisplayOnDevices}" Content="Show preview" VerticalAlignment="Center" />
<controls:ColorPickerButton Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Color="{Binding CurrentColor, Converter={StaticResource SKColorToColorConverter}}"
ShowAcceptDismissButtons="False" />
</Grid>
</StackPanel>
</Grid> </Grid>
<Rectangle Grid.Column="1" VerticalAlignment="Stretch" Width="1" Fill="{DynamicResource ButtonBorderBrush}" Margin="0 0 0 5" /> <!-- Layout -->
<TextBlock Classes="h4">
Layout
</TextBlock>
<TextBlock TextWrapping="Wrap">
The device layout is used to determine the position of LEDs and to create the visual representation of the device you see on the left side of this window.
</TextBlock>
<StackPanel Grid.Column="2"> <CheckBox Margin="0 0 0 5" IsChecked="{Binding Device.DisableDefaultLayout}">
<TextBlock Classes="h4"> <CheckBox.Content>
Color calibration <StackPanel Orientation="Horizontal">
</TextBlock> <TextBlock>Don't load default layout</TextBlock>
<avalonia:MaterialIcon Kind="HelpCircle"
Margin="5 0"
ToolTip.Tip="With this enabled Artemis will not load a layout for this device unless you specifically provide one." />
</StackPanel>
</CheckBox.Content>
</CheckBox>
<TextBlock TextWrapping="Wrap"> <Grid>
Use the sliders below to adjust the colors of your device so that it matches your other devices. <TextBox Text="{Binding Device.CustomLayoutPath}"
</TextBlock> Watermark="Custom layout path"
UseFloatingWatermark="True"
IsReadOnly="True"
PointerReleased="InputElement_OnPointerReleased"
Padding="10 5 36 6" />
<Button Classes="AppBarButton" HorizontalAlignment="Right" Command="{Binding ClearCustomLayout}" Padding="6" Margin="5 0">
<avalonia:MaterialIcon Kind="CloseCircle" />
</Button>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,*,*,*"> <controls:HyperlinkButton NavigateUri="https://wiki.artemis-rgb.com/en/guides/developer/layouts" Margin="0 20" HorizontalAlignment="Right">
<Label Grid.Row="0" Grid.Column="0" Content="R" VerticalAlignment="Center" /> Learn more about layouts on the wiki
<Slider Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="200" Value="{Binding RedScale}" Margin="10 0" VerticalAlignment="Center" /> </controls:HyperlinkButton>
<NumericUpDown Grid.Row="0" </StackPanel>
Grid.Column="2"
VerticalAlignment="Center"
Width="65"
Value="{Binding RedScale}"
ShowButtonSpinner="False"
FormatString="{}{0:0.0}"
Minimum="0"
Maximum="200"
ClipValueToMinMax="True" />
<Label Grid.Row="1" Grid.Column="0" Content="G" VerticalAlignment="Center" /> <!-- Buttons -->
<Slider Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="200" Value="{Binding GreenScale}" Margin="10 0" VerticalAlignment="Center" /> <Grid Grid.Row="1" ColumnDefinitions="Auto,*">
<NumericUpDown Grid.Row="1" <Button Grid.Column="0" Command="{Binding SelectPhysicalLayout}" ToolTip.Tip="Restart device setup, allowing you to select a new physical and logical layout">
Grid.Column="2" Restart setup
VerticalAlignment="Center" </Button>
Width="65"
Value="{Binding GreenScale}"
ShowButtonSpinner="False"
FormatString="{}{0:0.0}"
Minimum="0"
Maximum="200"
ClipValueToMinMax="True" />
<Label Grid.Row="2" Grid.Column="0" Content="B" VerticalAlignment="Center" /> <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Slider Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="200" Value="{Binding BlueScale}" Margin="10 0" Ticks="100" VerticalAlignment="Center" /> <Button IsCancel="True" Command="{Binding Reset}" Margin="0 0 5 0">Reset</Button>
<NumericUpDown Grid.Row="2" <Button Classes="accent" IsDefault="True" Command="{Binding Apply}">Apply</Button>
Grid.Column="2"
VerticalAlignment="Center"
Width="65"
Value="{Binding BlueScale}"
ShowButtonSpinner="False"
FormatString="{}{0:0.0}"
Minimum="0"
Maximum="200"
ClipValueToMinMax="True" />
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" IsChecked="{Binding DisplayOnDevices}" Content="Show preview" VerticalAlignment="Center" />
<controls:ColorPickerButton Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Color="{Binding CurrentColor, Converter={StaticResource SKColorToColorConverter}}"
ShowAcceptDismissButtons="False" />
</Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>
<!-- Layout -->
<TextBlock Classes="h4">
Layout
</TextBlock>
<TextBlock TextWrapping="Wrap">
The device layout is used to determine the position of LEDs and to create the visual representation of the device you see on the left side of this window.
</TextBlock>
<CheckBox Margin="0 0 0 5" IsChecked="{Binding Device.DisableDefaultLayout}">
<CheckBox.Content>
<StackPanel Orientation="Horizontal">
<TextBlock>Don't load default layout</TextBlock>
<avalonia:MaterialIcon Kind="HelpCircle"
Margin="5 0"
ToolTip.Tip="With this enabled Artemis will not load a layout for this device unless you specifically provide one." />
</StackPanel>
</CheckBox.Content>
</CheckBox>
<Grid>
<TextBox Text="{Binding Device.CustomLayoutPath}"
Watermark="Custom layout path"
UseFloatingWatermark="True"
IsReadOnly="True"
PointerReleased="InputElement_OnPointerReleased"
Padding="10 5 36 6" />
<Button Classes="AppBarButton" HorizontalAlignment="Right" Command="{Binding ClearCustomLayout}" Padding="6" Margin="5 0">
<avalonia:MaterialIcon Kind="CloseCircle" />
</Button>
</Grid>
<controls:HyperlinkButton NavigateUri="https://wiki.artemis-rgb.com/en/guides/developer/layouts" Margin="0 20" HorizontalAlignment="Right">
Learn more about layouts on the wiki
</controls:HyperlinkButton>
</StackPanel>
<!-- Buttons -->
<Grid Grid.Row="1" ColumnDefinitions="Auto,*">
<Button Grid.Column="0" Command="{Binding SelectPhysicalLayout}" 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="{Binding Reset}" Margin="0 0 5 0">Reset</Button>
<Button Classes="accent" IsDefault="True" Command="{Binding Apply}">Apply</Button>
</StackPanel>
</Grid> </Grid>
</Grid> </ScrollViewer>
</UserControl> </UserControl>

View File

@ -7,68 +7,65 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.InputMappingsTabView" x:Class="Artemis.UI.Screens.Device.InputMappingsTabView"
x:DataType="device:InputMappingsTabViewModel"> x:DataType="device:InputMappingsTabViewModel">
<Grid> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<Grid.RowDefinitions> <Grid RowDefinitions="Auto,Auto,*">
<RowDefinition Height="Auto" /> <StackPanel Grid.Row="0">
<RowDefinition Height="Auto" /> <TextBlock Classes="h4">
<RowDefinition Height="*" /> Introduction
</Grid.RowDefinitions> </TextBlock>
<StackPanel Grid.Row="0"> <TextBlock TextWrapping="Wrap">
<TextBlock Classes="h4"> In some cases you may want Artemis to map key presses to different LEDs.
Introduction </TextBlock>
</TextBlock> <TextBlock TextWrapping="Wrap" Margin="0 13 0 0">
<TextBlock TextWrapping="Wrap"> This is useful when your logical layout swaps keys around (like Hungarian layouts where the Z and Y keys are swapped). In this tab you can set up these custom input mappings, simply click on a LED and press a key, Artemis will from then on consider that LED pressed whenever you press the same key again.
In some cases you may want Artemis to map key presses to different LEDs. </TextBlock>
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0 13 0 0">
This is useful when your logical layout swaps keys around (like Hungarian layouts where the Z and Y keys are swapped). In this tab you can set up these custom input mappings, simply click on a LED and press a key, Artemis will from then on consider that LED pressed whenever you press the same key again.
</TextBlock>
</StackPanel>
<TextBlock Grid.Row="1"
Margin="0 20"
Classes="h4"
TextAlignment="Center"
IsVisible="{CompiledBinding SelectedLed, Converter={x:Static ObjectConverters.IsNull}}">
Select a LED in the preview on the left side to get started...
</TextBlock>
<StackPanel Grid.Row="1" Margin="0 20" IsVisible="{CompiledBinding SelectedLed, Converter={x:Static ObjectConverters.IsNotNull}}">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="6">
<TextBlock Classes="h4" TextAlignment="Center">Current target LED: </TextBlock>
<TextBlock Classes="h4" TextAlignment="Center" Text="{CompiledBinding SelectedLed.RgbLed.Id, Mode=OneWay, FallbackValue='none'}"/>
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="5">
<TextBlock TextAlignment="Center">Press the key you want to remap</TextBlock> <TextBlock Grid.Row="1"
<TextBlock TextAlignment="Center" FontWeight="Bold" Text="{CompiledBinding SelectedLed.RgbLed.Id, Mode=OneWay, FallbackValue='none'}"/> Margin="0 20"
<TextBlock TextAlignment="Center">to ...</TextBlock> Classes="h4"
TextAlignment="Center"
IsVisible="{CompiledBinding SelectedLed, Converter={x:Static ObjectConverters.IsNull}}">
Select a LED in the preview on the left side to get started...
</TextBlock>
<StackPanel Grid.Row="1" Margin="0 20" IsVisible="{CompiledBinding SelectedLed, Converter={x:Static ObjectConverters.IsNotNull}}">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="6">
<TextBlock Classes="h4" TextAlignment="Center">Current target LED: </TextBlock>
<TextBlock Classes="h4" TextAlignment="Center" Text="{CompiledBinding SelectedLed.RgbLed.Id, Mode=OneWay, FallbackValue='none'}" />
</StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="5">
<TextBlock TextAlignment="Center">Press the key you want to remap</TextBlock>
<TextBlock TextAlignment="Center" FontWeight="Bold" Text="{CompiledBinding SelectedLed.RgbLed.Id, Mode=OneWay, FallbackValue='none'}" />
<TextBlock TextAlignment="Center">to ...</TextBlock>
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel>
<DataGrid Grid.Row="2" <DataGrid Grid.Row="2"
Items="{CompiledBinding InputMappings}" Items="{CompiledBinding InputMappings}"
CanUserSortColumns="True" CanUserSortColumns="True"
IsReadOnly="True" IsReadOnly="True"
AutoGenerateColumns="False" AutoGenerateColumns="False"
Margin="10"> Margin="10">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding [0].RgbLed.Id}" Header="Original LED ID" Width="*" /> <DataGridTextColumn Binding="{Binding [0].RgbLed.Id}" Header="Original LED ID" Width="*" />
<DataGridTextColumn Binding="{Binding [1].RgbLed.Id}" Header="Remapped LED ID" Width="*" /> <DataGridTextColumn Binding="{Binding [1].RgbLed.Id}" Header="Remapped LED ID" Width="*" />
<DataGridTemplateColumn Width="Auto" IsReadOnly="True"> <DataGridTemplateColumn Width="Auto" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<Button Command="{Binding $parent[UserControl].DataContext.DeleteMapping}" <Button Command="{Binding $parent[UserControl].DataContext.DeleteMapping}"
CommandParameter="{Binding}" CommandParameter="{Binding}"
Classes="icon-button" Classes="icon-button"
ToolTip.Tip="Delete mapping" ToolTip.Tip="Delete mapping"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<avalonia:MaterialIcon Kind="Delete" /> <avalonia:MaterialIcon Kind="Delete" />
</Button> </Button>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</Grid> </Grid>
</ScrollViewer>
</UserControl> </UserControl>

View File

@ -7,8 +7,8 @@
xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared" xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
xmlns:workshop="clr-namespace:Artemis.UI.Screens.Workshop" xmlns:workshop="clr-namespace:Artemis.UI.Screens.Workshop"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.GradientPicker;assembly=Artemis.UI.Shared"
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" mc:Ignorable="d" d:DesignWidth="800"
x:Class="Artemis.UI.Screens.Workshop.WorkshopView" x:Class="Artemis.UI.Screens.Workshop.WorkshopView"
x:DataType="workshop:WorkshopViewModel"> x:DataType="workshop:WorkshopViewModel">

View File

@ -1,38 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" /> <PackageReference Include="Avalonia" Version="0.10.15"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.15"/>
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.14"/>
<PackageReference Include="Ninject" Version="3.3.4" /> <PackageReference Include="Ninject" Version="3.3.4"/>
<PackageReference Include="NoStringEvaluating" Version="2.2.2" /> <PackageReference Include="NoStringEvaluating" Version="2.2.2"/>
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50"/>
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1"/>
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.1" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.1"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj"/>
<ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj" /> <ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Nodes\Easing\Screens\EasingTypeNodeEasingView.axaml.cs"> <Compile Update="Nodes\Easing\Screens\EasingTypeNodeEasingView.axaml.cs">
<DependentUpon>EasingTypeNodeEasingView.axaml</DependentUpon> <DependentUpon>EasingTypeNodeEasingView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Nodes\Static\Screens\StaticStringValueNodeCustomView.axaml.cs"> <Compile Update="Nodes\Static\Screens\StaticStringValueNodeCustomView.axaml.cs">
<DependentUpon>StaticStringValueNodeCustomView.axaml</DependentUpon> <DependentUpon>StaticStringValueNodeCustomView.axaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Nodes\DataModel\Screens\DataModelNodeCustomView.axaml.cs"> <Compile Update="Nodes\DataModel\Screens\DataModelNodeCustomView.axaml.cs">
<DependentUpon>DataModelNodeCustomView.axaml</DependentUpon> <DependentUpon>DataModelNodeCustomView.axaml</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder> <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup> </PropertyGroup>
</Project> </Project>