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

Profile editor - Added initial VMs and UI panels

UI screens - Simplified namespaces
This commit is contained in:
Robert 2021-12-11 00:53:48 +01:00
parent 9a4e7f9c9f
commit 16b6bb47b4
81 changed files with 738 additions and 355 deletions

View File

@ -28,6 +28,14 @@ namespace Artemis.UI.Shared
public void Close()
{
CloseRequested?.Invoke(this, EventArgs.Empty);
OnCloseRequested();
}
/// <summary>
/// Called when the the window hosting the view model should close
/// </summary>
public virtual void OnCloseRequested()
{
}
/// <summary>

View File

@ -10,6 +10,16 @@
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Black" Opacity="0.15" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
<VisualBrush x:Key="LargeCheckerboardBrush" TileMode="Tile" Stretch="Uniform" SourceRect="0,0,25,25">
<VisualBrush.Visual>
<Grid Width="25" Height="25" RowDefinitions="*,*" ColumnDefinitions="*,*">
<Rectangle Grid.Row="0" Grid.Column="0" Fill="Black" Opacity="0.15" />
<Rectangle Grid.Row="0" Grid.Column="1" />
<Rectangle Grid.Row="1" Grid.Column="0" />
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Black" Opacity="0.15" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Styles.Resources>
<StyleInclude Source="/Styles/Border.axaml" />

View File

@ -22,6 +22,7 @@
<!-- Add Styles Here -->
<Style Selector="Border.router-container">
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorTertiary}" />
<Setter Property="Margin" Value="0 10 0 0"></Setter>
<Setter Property="CornerRadius" Value="8 0 0 0" />
<Setter Property="ClipToBounds" Value="True" />
</Style>
@ -33,7 +34,7 @@
</Style>
<Style Selector="Border.card-condensed">
<Setter Property="Padding" Value="15" />
<Setter Property="Padding" Value="10" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource CardCornerRadius}" />
</Style>

View File

@ -1,2 +1,9 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Cdebugger_005Ctabs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Cdevice_005Ctabs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Cplugins_005Cdialogs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Cprofileeditor_005Cpanels/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Csettings_005Ctabs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Csidebar_005Ccontentdialogs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=screens_005Csidebar_005Cdialogs/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -1,10 +1,9 @@
using System.Collections.ObjectModel;
using Artemis.Core;
using Artemis.UI.Screens.Device;
using Artemis.UI.Screens.Device.Tabs;
using Artemis.UI.Screens.Plugins;
using Artemis.UI.Screens.ProfileEditor;
using Artemis.UI.Screens.Settings.Tabs;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Screens.Sidebar;
using Artemis.UI.Screens.SurfaceEditor;
using Artemis.UI.Services;

View File

@ -1,10 +1,10 @@
using System;
using System.Reactive.Disposables;
using Artemis.UI.Screens.Debugger.Tabs.DataModel;
using Artemis.UI.Screens.Debugger.Tabs.Logs;
using Artemis.UI.Screens.Debugger.Tabs.Performance;
using Artemis.UI.Screens.Debugger.Tabs.Render;
using Artemis.UI.Screens.Debugger.Tabs.Settings;
using Artemis.UI.Screens.Debugger.DataModel;
using Artemis.UI.Screens.Debugger.Logs;
using Artemis.UI.Screens.Debugger.Performance;
using Artemis.UI.Screens.Debugger.Render;
using Artemis.UI.Screens.Debugger.Settings;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared;
using FluentAvalonia.UI.Controls;

View File

@ -5,7 +5,7 @@
xmlns:dataModel="clr-namespace:Artemis.UI.Shared.DataModelVisualization.Shared;assembly=Artemis.UI.Shared"
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.DataModel.DataModelDebugView">
x:Class="Artemis.UI.Screens.Debugger.DataModel.DataModelDebugView">
<UserControl.Resources>
<converters:TypeToStringConverter x:Key="TypeToStringConverter" />
</UserControl.Resources>

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.DataModel
namespace Artemis.UI.Screens.Debugger.DataModel
{
public class DataModelDebugView : ReactiveUserControl<DataModelDebugViewModel>
{

View File

@ -10,12 +10,11 @@ using Artemis.Core.Modules;
using Artemis.Core.Services;
using Artemis.UI.Shared;
using Artemis.UI.Shared.DataModelVisualization.Shared;
using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.Interfaces;
using DynamicData;
using ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.DataModel
namespace Artemis.UI.Screens.Debugger.DataModel
{
public class DataModelDebugViewModel : ActivatableViewModelBase, IRoutableViewModel
{

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Logs.LogsDebugView">
x:Class="Artemis.UI.Screens.Debugger.Logs.LogsDebugView">
<StackPanel>
<TextBlock Classes="h3">Logs</TextBlock>
<TextBlock TextWrapping="Wrap">

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Logs
namespace Artemis.UI.Screens.Debugger.Logs
{
public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
{

View File

@ -1,7 +1,7 @@
using Artemis.UI.Shared;
using ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Logs
namespace Artemis.UI.Screens.Debugger.Logs
{
public class LogsDebugViewModel : ActivatableViewModelBase, IRoutableViewModel
{

View File

@ -2,7 +2,7 @@
using Artemis.UI.Shared;
using ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public class PerformanceDebugMeasurementViewModel : ViewModelBase
{

View File

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Performance.PerformanceDebugPluginView">
x:Class="Artemis.UI.Screens.Debugger.Performance.PerformanceDebugPluginView">
<Border Classes="card-condensed" Margin="0 5">
<StackPanel>
<Grid ColumnDefinitions="40,*">

View File

@ -1,8 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public partial class PerformanceDebugPluginView : UserControl
{

View File

@ -3,7 +3,7 @@ using System.Linq;
using Artemis.Core;
using Artemis.UI.Shared;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public class PerformanceDebugPluginViewModel : ViewModelBase
{

View File

@ -2,9 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Artemis.UI.Screens.Debugger.Tabs.Performance"
xmlns:local="clr-namespace:Artemis.UI.Screens.Debugger.Performance"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Performance.PerformanceDebugProfilerView">
x:Class="Artemis.UI.Screens.Debugger.Performance.PerformanceDebugProfilerView">
<StackPanel>
<TextBlock Classes="subtitle" Text="{Binding Profiler.Name}" Margin="10 10 0 0" />

View File

@ -1,8 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public partial class PerformanceDebugProfilerView : UserControl
{

View File

@ -3,7 +3,7 @@ using System.Linq;
using Artemis.Core;
using Artemis.UI.Shared;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public class PerformanceDebugProfilerViewModel : ViewModelBase
{

View File

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Performance.PerformanceDebugView">
x:Class="Artemis.UI.Screens.Debugger.Performance.PerformanceDebugView">
<Grid RowDefinitions="Auto,*">
<StackPanel Grid.Row="0">
<TextBlock Classes="h3">Performance</TextBlock>

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public class PerformanceDebugView : ReactiveUserControl<PerformanceDebugViewModel>
{

View File

@ -9,7 +9,7 @@ using Artemis.Core.Services;
using Artemis.UI.Shared;
using ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Performance
namespace Artemis.UI.Screens.Debugger.Performance
{
public class PerformanceDebugViewModel : ActivatableViewModelBase, IRoutableViewModel
{

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Render.RenderDebugView">
x:Class="Artemis.UI.Screens.Debugger.Render.RenderDebugView">
<StackPanel>
<TextBlock Classes="h3">Render</TextBlock>
<TextBlock TextWrapping="Wrap">

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Render
namespace Artemis.UI.Screens.Debugger.Render
{
public class RenderDebugView : ReactiveUserControl<RenderDebugViewModel>
{

View File

@ -1,19 +1,13 @@
using System.Diagnostics;
using System.IO;
using System.IO;
using System.Reactive.Disposables;
using System.Reflection.Metadata.Ecma335;
using System.Timers;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using ReactiveUI;
using SkiaSharp;
namespace Artemis.UI.Screens.Debugger.Tabs.Render
namespace Artemis.UI.Screens.Debugger.Render
{
public class RenderDebugViewModel : ActivatableViewModelBase, IRoutableViewModel
{

View File

@ -3,6 +3,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Settings.DebugSettingsView">
x:Class="Artemis.UI.Screens.Debugger.Settings.DebugSettingsView">
<TextBlock>Settings</TextBlock>
</UserControl>

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Settings
namespace Artemis.UI.Screens.Debugger.Settings
{
public class DebugSettingsView : ReactiveUserControl<DebugSettingsViewModel>
{

View File

@ -1,7 +1,7 @@
using Artemis.UI.Shared;
using ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Tabs.Settings
namespace Artemis.UI.Screens.Debugger.Settings
{
public class DebugSettingsViewModel : ActivatableViewModelBase, IRoutableViewModel
{

View File

@ -3,7 +3,7 @@ using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.Settings.Tabs;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Avalonia.Threading;

View File

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.Tabs.DeviceInfoTabView">
x:Class="Artemis.UI.Screens.Device.DeviceInfoTabView">
<Grid RowDefinitions="Auto,*" ColumnDefinitions="*,*" Margin="-5">
<!-- First row -->
<Border Classes="card" Grid.Column="0" Grid.Row="0" Margin="5">

View File

@ -1,7 +1,7 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public partial class DeviceInfoTabView : UserControl
{

View File

@ -5,7 +5,7 @@ using Artemis.UI.Shared.Services.Interfaces;
using Avalonia;
using RGB.NET.Core;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public class DeviceInfoTabViewModel : ActivatableViewModelBase
{

View File

@ -3,6 +3,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.Tabs.DeviceLedsTabView">
x:Class="Artemis.UI.Screens.Device.DeviceLedsTabView">
Welcome to Avalonia!
</UserControl>

View File

@ -1,7 +1,7 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public partial class DeviceLedsTabView : UserControl
{

View File

@ -8,7 +8,7 @@ using Artemis.UI.Shared;
using DynamicData.Binding;
using ReactiveUI;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public class DeviceLedsTabViewModel : ActivatableViewModelBase
{

View File

@ -5,14 +5,14 @@
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
xmlns:tabs="clr-namespace:Artemis.UI.Screens.Device.Tabs"
xmlns:device="clr-namespace:Artemis.UI.Screens.Device"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1200"
x:Class="Artemis.UI.Screens.Device.Tabs.DevicePropertiesTabView">
x:Class="Artemis.UI.Screens.Device.DevicePropertiesTabView">
<UserControl.Resources>
<converters:SKColorToColorConverter x:Key="SKColorToColorConverter" />
</UserControl.Resources>
<Design.DataContext>
<tabs:DevicePropertiesTabViewModel />
<device:DevicePropertiesTabViewModel />
</Design.DataContext>
<!-- Body -->

View File

@ -2,7 +2,7 @@ using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public partial class DevicePropertiesTabView : ReactiveUserControl<DevicePropertiesTabViewModel>
{

View File

@ -10,7 +10,7 @@ using Artemis.UI.Shared.Services.Interfaces;
using ReactiveUI;
using SkiaSharp;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public class DevicePropertiesTabViewModel : ActivatableViewModelBase
{

View File

@ -3,6 +3,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Device.Tabs.InputMappingsTabView">
x:Class="Artemis.UI.Screens.Device.InputMappingsTabView">
Welcome to Avalonia!
</UserControl>

View File

@ -1,7 +1,7 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public partial class InputMappingsTabView : UserControl
{

View File

@ -9,7 +9,7 @@ using Artemis.UI.Shared;
using ReactiveUI;
using RGB.NET.Core;
namespace Artemis.UI.Screens.Device.Tabs
namespace Artemis.UI.Screens.Device
{
public class InputMappingsTabViewModel : ActivatableViewModelBase
{

View File

@ -6,123 +6,124 @@
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="900"
x:Class="Artemis.UI.Screens.Home.HomeView">
<Grid RowDefinitions="200,*">
<Image Grid.Row="0"
Grid.RowSpan="2"
VerticalAlignment="Top"
Source="/Assets/Images/home-banner.png"
Height="200"
Stretch="UniformToFill" />
<Border Classes="router-container">
<Grid RowDefinitions="200,*">
<Image Grid.Row="0"
Grid.RowSpan="2"
VerticalAlignment="Top"
Source="/Assets/Images/home-banner.png"
Height="200"
Stretch="UniformToFill" />
<!-- TODO: Replace with a shadow when available -->
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
Foreground="Black"
FontSize="32"
Margin="32"
Text=" Welcome to Artemis, the unified RGB platform." />
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
FontSize="32"
Margin="30"
Text=" Welcome to Artemis, the unified RGB platform." />
<!-- TODO: Replace with a shadow when available -->
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
Foreground="Black"
FontSize="32"
Margin="32"
Text=" Welcome to Artemis, the unified RGB platform." />
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
FontSize="32"
Margin="30"
Text=" Welcome to Artemis, the unified RGB platform." />
<Grid Grid.Row="1" MaxWidth="840" Margin="30" VerticalAlignment="Bottom" ColumnDefinitions="*,*" RowDefinitions="*,*">
<Border Classes="card" Margin="8" Grid.ColumnSpan="2" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="Auto,Auto" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Plug" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Plugins</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
Artemis is built up using plugins. This means devices, brushes, effects and modules (for supporting games) can all be added via plugins.
</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" Margin="0 15">
Under Settings > Plugins you can find your currently installed plugins, these default plugins are created by Artemis developers. We're also keeping track of a list of third-party plugins on our wiki.
</TextBlock>
</StackPanel>
<controls:HyperlinkButton Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins" HorizontalAlignment="Right">
<controls:HyperlinkButton.ContextMenu>
<ContextMenu>
<MenuItem Header="Test"></MenuItem>
</ContextMenu>
</controls:HyperlinkButton.ContextMenu>
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="OpenInBrowser" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Get more plugins</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</Border>
<Grid Grid.Row="1" MaxWidth="840" Margin="30" VerticalAlignment="Bottom" ColumnDefinitions="*,*" RowDefinitions="*,*">
<Border Classes="card" Margin="8" Grid.ColumnSpan="2" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="Auto,Auto" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Plug" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Plugins</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
Artemis is built up using plugins. This means devices, brushes, effects and modules (for supporting games) can all be added via plugins.
</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" Margin="0 15">
Under Settings > Plugins you can find your currently installed plugins, these default plugins are created by Artemis developers. We're also keeping track of a list of third-party plugins on our wiki.
</TextBlock>
</StackPanel>
<controls:HyperlinkButton Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins" HorizontalAlignment="Right">
<controls:HyperlinkButton.ContextMenu>
<ContextMenu>
<MenuItem Header="Test"></MenuItem>
</ContextMenu>
</controls:HyperlinkButton.ContextMenu>
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="OpenInBrowser" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Get more plugins</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</Border>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="0" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Discord" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Have a chat</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
If you need help, have some feedback or have any other questions feel free to contact us through any of the following channels.
</TextBlock>
</StackPanel>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="0" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Discord" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Have a chat</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
If you need help, have some feedback or have any other questions feel free to contact us through any of the following channels.
</TextBlock>
</StackPanel>
<DockPanel Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0">
<Grid Margin="8" RowDefinitions="*,*">
<controls:HyperlinkButton Grid.Row="0" NavigateUri="https://github.com/Artemis-RGB/Artemis">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">GitHub</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="0" HorizontalAlignment="Right" NavigateUri="https://artemis-rgb.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Web" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Website</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" NavigateUri="https://discordapp.com/invite/S3MVaC9">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Discord" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Discord</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" HorizontalAlignment="Right" NavigateUri="mailto:spoinky.nl@gmail.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Email" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">E-mail</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</DockPanel>
</Grid>
</Border>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="1" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Github" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Open Source</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
This project is open source. If you like it and want to say thanks you could hit the GitHub Star button, I like numbers.
</TextBlock>
</StackPanel>
<DockPanel Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0">
<Grid Margin="8" RowDefinitions="*,*">
<controls:HyperlinkButton Grid.Row="0" NavigateUri="https://github.com/Artemis-RGB/Artemis">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">GitHub</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="0" HorizontalAlignment="Right" NavigateUri="https://artemis-rgb.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Web" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Website</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" NavigateUri="https://discordapp.com/invite/S3MVaC9">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Discord" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Discord</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" HorizontalAlignment="Right" NavigateUri="mailto:spoinky.nl@gmail.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Email" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">E-mail</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</DockPanel>
</Grid>
</Border>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="1" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Github" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Open Source</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
This project is open source. If you like it and want to say thanks you could hit the GitHub Star button, I like numbers.
</TextBlock>
</StackPanel>
<controls:HyperlinkButton Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Center"
NavigateUri="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VQBAEJYUFLU4J">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Donate</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<TextBlock Grid.Row="1"
Grid.Column="1"
Foreground="{DynamicResource MaterialDesignBodyLight}"
TextWrapping="Wrap"
VerticalAlignment="Center">
Feel like making a donation? It would be gratefully received. Click the button to donate via PayPal.
</TextBlock>
</Grid>
</Border>
</Grid>
</Grid>
<controls:HyperlinkButton Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Center"
NavigateUri="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VQBAEJYUFLU4J">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Donate</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<TextBlock Grid.Row="1"
Grid.Column="1"
Foreground="{DynamicResource MaterialDesignBodyLight}"
TextWrapping="Wrap"
VerticalAlignment="Center">
Feel like making a donation? It would be gratefully received. Click the button to donate via PayPal.
</TextBlock>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</UserControl>

View File

@ -10,7 +10,7 @@ using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using ReactiveUI;
namespace Artemis.UI.Screens.Plugins.Dialogs
namespace Artemis.UI.Screens.Plugins
{
public class PluginPrerequisitesInstallDialogViewModel : DialogViewModelBase<bool>
{

View File

@ -11,7 +11,7 @@ using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using ReactiveUI;
namespace Artemis.UI.Screens.Plugins.Dialogs
namespace Artemis.UI.Screens.Plugins
{
public class PluginPrerequisitesUninstallDialogViewModel : DialogViewModelBase<bool>
{

View File

@ -4,7 +4,6 @@ using System.Linq;
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Screens.Plugins.Dialogs;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Builders;
using Artemis.UI.Shared.Services.Interfaces;

View File

@ -9,7 +9,6 @@ using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Exceptions;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.Plugins.Dialogs;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;
using Avalonia.Threading;

View File

@ -0,0 +1,41 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:paz="clr-namespace:Avalonia.Controls.PanAndZoom;assembly=Avalonia.Controls.PanAndZoom"
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.ProfileEditor.VisualEditor.VisualEditorView">
<paz:ZoomBorder Name="ZoomBorder"
Stretch="None"
ZoomSpeed="1.2"
ClipToBounds="True"
Focusable="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Background="{DynamicResource LargeCheckerboardBrush}"
ZoomChanged="ZoomBorder_OnZoomChanged">
<Grid Name="ContainerGrid"
Background="Transparent">
<ItemsControl Items="{Binding Devices}" ClipToBounds="False">
<ItemsControl.Styles>
<Style Selector="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding X}" />
<Setter Property="Canvas.Top" Value="{Binding Y}" />
</Style>
</ItemsControl.Styles>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="core:ArtemisDevice">
<controls:DeviceVisualizer Device="{Binding}" ShowColors="True" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</paz:ZoomBorder>
</UserControl>

View File

@ -0,0 +1,45 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.VisualEditor
{
public class VisualEditorView : ReactiveUserControl<VisualEditorViewModel>
{
private readonly ZoomBorder _zoomBorder;
public VisualEditorView()
{
InitializeComponent();
_zoomBorder = this.Find<ZoomBorder>("ZoomBorder");
_zoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
UpdateZoomBorderBackground();
}
private void ZoomBorderOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property.Name == nameof(_zoomBorder.Background))
UpdateZoomBorderBackground();
}
private void UpdateZoomBorderBackground()
{
if (_zoomBorder.Background is VisualBrush visualBrush)
visualBrush.DestinationRect = new RelativeRect(_zoomBorder.OffsetX * -1, _zoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void ZoomBorder_OnZoomChanged(object sender, ZoomChangedEventArgs e)
{
UpdateZoomBorderBackground();
}
}
}

View File

@ -0,0 +1,18 @@
using System.Collections.ObjectModel;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Services;
using Artemis.UI.Shared;
namespace Artemis.UI.Screens.ProfileEditor.VisualEditor
{
public class VisualEditorViewModel : ActivatableViewModelBase
{
public VisualEditorViewModel(IProfileEditorService profileEditorService, IRgbService rgbService)
{
Devices = new ObservableCollection<ArtemisDevice>(rgbService.EnabledDevices);
}
public ObservableCollection<ArtemisDevice> Devices { get; }
}
}

View File

@ -2,12 +2,265 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileEditorView">
<StackPanel Orientation="Horizontal">
<TextBlock Classes="h4 subtitle" Text="Wow, you're editing "/>
<TextBlock Classes="h4" Text="{Binding Profile.Name}"/>
<TextBlock Classes="h4 subtitle" Text=". That's amazing! keep it up man, you can do it!!!!11!11"/>
</StackPanel>
<UserControl.Styles>
<Style Selector="GridSplitter.editor-grid-splitter-vertical">
<Setter Property="MinWidth" Value="4" />
<Setter Property="Margin" Value="1 1 1 5" />
</Style>
<Style Selector="GridSplitter.editor-grid-splitter-horizontal">
<Setter Property="MinHeight" Value="4" />
<Setter Property="Margin" Value="5 1" />
</Style>
<Style Selector=":is(Button).editor-sidebar-button">
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="40" />
<Setter Property="Margin" Value="4" />
</Style>
<Style Selector=":is(Button).editor-sidebar-button avalonia|MaterialIcon">
<Setter Property="Width" Value="18" />
<Setter Property="Height" Value="18" />
</Style>
</UserControl.Styles>
<Grid ColumnDefinitions="4*,Auto,*" RowDefinitions="Auto,*" Margin="0 0 4 4">
<Menu Grid.Row="0" Grid.ColumnSpan="3" VerticalAlignment="Top">
<MenuItem Header="_File">
<MenuItem Header="New">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Plus" />
</MenuItem.Icon>
<MenuItem Header="Folder" Command="{Binding AddFolder}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Folder" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Layer" Command="{Binding AddLayer}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Layers" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<Separator />
<MenuItem Header="View Properties" Command="{Binding ViewProperties}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Settings" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_View Scripts" Command="{Binding ViewScripts}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="BookEdit" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Adapt Profile" Command="{Binding AdaptProfile}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Magic" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Suspend Profile">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding ProfileConfiguration.IsSuspended}" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Export Profile" Command="{Binding ExportProfile}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Export" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Duplicate Profile" Command="{Binding DuplicateProfile}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ContentDuplicate" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Delete Profile" Command="{Binding DeleteProfile}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Trash" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_Edit" SubmenuOpened="MenuItem_OnSubmenuOpened">
<MenuItem Header="_Duplicate"
Command="{Binding Duplicate}"
HotKey="Ctrl+D"
IsEnabled="{Binding HasSelectedElement}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ContentDuplicate" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Copy"
Command="{Binding Copy}"
HotKey="Ctrl+C"
IsEnabled="{Binding HasSelectedElement}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ContentCopy" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Paste"
Command="{Binding Paste}"
HotKey="Ctrl+V">
<MenuItem.Icon>
<avalonia:MaterialIconExt Kind="ContentPaste" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_Run">
<MenuItem Header="_Switch run mode"
Command="{Binding ToggleSuspend}"
HotKey="F5">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="SwapHorizontal" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Run Profile on Focus Loss"
ToolTip.Tip="If enabled, run mode is set to normal on focus loss"
HotKey="Shift+F5">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding StopOnFocusLoss.Value}" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_Options">
<MenuItem Header="Focus Selected Layer"
ToolTip.Tip="If enabled, displays only the layer you currently have selected"
IsEnabled="False">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding FocusSelectedLayer.Value}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Display Data Model Values">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding ShowDataModelValues.Value}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Display Full Condition Paths">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding ShowFullPaths.Value}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Always Display Cable Values" ToolTip.Tip="If enabled, cable values are always shown instead of only on hover">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding AlwaysShowValues.Value}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Apply All Data Bindings During Edit" ToolTip.Tip="If enabled, updates all data bindings instead of only the one you are editing">
<MenuItem.Icon>
<CheckBox BorderThickness="0"
IsHitTestVisible="False"
IsChecked="{Binding AlwaysApplyDataBindings.Value}" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="Artemis Wiki" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="BookEdit" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Editor" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/en/guides/user/profiles">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Edit" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Layers" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/layers">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Layers" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Display Conditions" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/conditions">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="NotEqual" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Timeline" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/timeline">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Stopwatch" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Data Bindings" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/data-bindings">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="VectorLink" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Scripting" Command="{Binding OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/scripting">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="CodeJson" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Report a Bug" Command="{Binding OpenUrl}" CommandParameter="https://github.com/Artemis-RGB/Artemis/issues">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Github" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Get Help on Discord" Command="{Binding OpenUrl}" CommandParameter="https://discord.gg/S3MVaC9">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Discord" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
</UserControl>
<Grid Grid.Row="1" Grid.Column="0" RowDefinitions="3*,Auto,*">
<Border Grid.Row="0" Classes="card" Padding="0" Margin="4 0 4 4" ClipToBounds="True">
<Grid ColumnDefinitions="Auto,*">
<Border Grid.Column="0" Background="{DynamicResource CardStrokeColorDefaultSolidBrush}">
<StackPanel Orientation="Vertical">
<ToggleButton Classes="icon-button editor-sidebar-button">
<avalonia:MaterialIcon Kind="HandLeft" />
</ToggleButton>
<ToggleButton Classes="icon-button editor-sidebar-button">
<avalonia:MaterialIcon Kind="TransitConnectionVariant" />
</ToggleButton>
<ToggleButton Classes="icon-button editor-sidebar-button">
<avalonia:MaterialIcon Kind="SelectionDrag" />
</ToggleButton>
<ToggleButton Classes="icon-button editor-sidebar-button">
<avalonia:MaterialIcon Kind="SelectOff" />
</ToggleButton>
</StackPanel>
</Border>
<ContentControl Grid.Column="1" Content="{Binding VisualEditorViewModel}" />
</Grid>
</Border>
<GridSplitter Grid.Row="1" Classes="editor-grid-splitter-horizontal" />
<Border Grid.Row="2" Classes="card card-condensed" Margin="4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Properties/timeline</TextBlock>
</Border>
</Grid>
<GridSplitter Grid.Row="1" Grid.Column="1" Classes="editor-grid-splitter-vertical" />
<Grid Grid.Row="1" Grid.Column="2" RowDefinitions="*,Auto,*">
<Border Grid.Row="0" Classes="card card-condensed" Margin="4 0 4 4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Profile elements</TextBlock>
</Border>
<GridSplitter Grid.Row="1" Classes="editor-grid-splitter-horizontal" />
<Border Grid.Row="2" Classes="card card-condensed" Margin="4">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Conditions</TextBlock>
</Border>
</Grid>
</Grid>
</UserControl>

View File

@ -1,3 +1,4 @@
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
@ -14,5 +15,10 @@ namespace Artemis.UI.Screens.ProfileEditor
{
AvaloniaXamlLoader.Load(this);
}
private void MenuItem_OnSubmenuOpened(object? sender, RoutedEventArgs e)
{
}
}
}

View File

@ -1,6 +1,7 @@
using System;
using System.Reactive.Disposables;
using Artemis.Core;
using Artemis.UI.Screens.ProfileEditor.VisualEditor;
using Artemis.UI.Services;
using ReactiveUI;
@ -11,18 +12,23 @@ namespace Artemis.UI.Screens.ProfileEditor
private ProfileConfiguration? _profile;
/// <inheritdoc />
public ProfileEditorViewModel(IScreen hostScreen, IProfileEditorService profileEditorService) : base(hostScreen, "profile-editor")
public ProfileEditorViewModel(IScreen hostScreen, VisualEditorViewModel visualEditorViewModel, IProfileEditorService profileEditorService) : base(hostScreen, "profile-editor")
{
this.WhenActivated(disposables =>
{
profileEditorService.CurrentProfileConfiguration.WhereNotNull().Subscribe(p => Profile = p).DisposeWith(disposables);
});
VisualEditorViewModel = visualEditorViewModel;
this.WhenActivated(disposables => { profileEditorService.CurrentProfileConfiguration.WhereNotNull().Subscribe(p => Profile = p).DisposeWith(disposables); });
}
public VisualEditorViewModel VisualEditorViewModel { get; }
public ProfileConfiguration? Profile
{
get => _profile;
set => this.RaiseAndSetIfChanged(ref _profile, value);
}
public void OpenUrl(string url)
{
Utilities.OpenUrl(url);
}
}
}

View File

@ -12,13 +12,10 @@
</Grid.ColumnDefinitions>
<ContentControl Grid.Column="0" Content="{Binding SidebarViewModel}" />
<Border Classes="router-container" Grid.Column="1" Margin="0 10 0 0">
<reactiveUi:RoutedViewHost Router="{Binding Router}">
<reactiveUi:RoutedViewHost.PageTransition>
<CrossFade Duration="0.1" />
</reactiveUi:RoutedViewHost.PageTransition>
</reactiveUi:RoutedViewHost>
</Border>
<reactiveUi:RoutedViewHost Grid.Column="1" Router="{Binding Router}">
<reactiveUi:RoutedViewHost.PageTransition>
<CrossFade Duration="0.1" />
</reactiveUi:RoutedViewHost.PageTransition>
</reactiveUi:RoutedViewHost>
</Grid>
</UserControl>

View File

@ -4,11 +4,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Settings.SettingsView">
<TabControl Margin="12" Items="{Binding SettingTabs}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
<Border Classes="router-container">
<TabControl Margin="12" Items="{Binding SettingTabs}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</Border>
</UserControl>

View File

@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using Artemis.UI.Screens.Settings.Tabs;
using Artemis.UI.Shared;
using ReactiveUI;

View File

@ -6,7 +6,7 @@
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1400"
x:Class="Artemis.UI.Screens.Settings.Tabs.AboutTabView">
x:Class="Artemis.UI.Screens.Settings.AboutTabView">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="15" MaxWidth="800">
<Grid RowDefinitions="*,*" ColumnDefinitions="Auto,*,Auto">

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public partial class AboutTabView : ReactiveUserControl<AboutTabViewModel>
{

View File

@ -8,7 +8,7 @@ using Avalonia.Media.Imaging;
using Flurl.Http;
using ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public class AboutTabViewModel : ActivatableViewModelBase
{

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Settings.Tabs.DevicesTabView">
x:Class="Artemis.UI.Screens.Settings.DevicesTabView">
<Grid MaxWidth="1050">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public class DevicesTabView : ReactiveUserControl<DevicesTabViewModel>
{

View File

@ -14,7 +14,7 @@ using Avalonia.Threading;
using DynamicData;
using ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public class DevicesTabViewModel : ActivatableViewModelBase
{

View File

@ -6,7 +6,7 @@
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="2400"
x:Class="Artemis.UI.Screens.Settings.Tabs.GeneralTabView">
x:Class="Artemis.UI.Screens.Settings.GeneralTabView">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="15" MaxWidth="1000">

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public partial class GeneralTabView : ReactiveUserControl<GeneralTabViewModel>
{

View File

@ -14,7 +14,7 @@ using Artemis.UI.Shared;
using ReactiveUI;
using Serilog.Events;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public class GeneralTabViewModel : ActivatableViewModelBase
{

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Settings.Tabs.PluginsTabView">
x:Class="Artemis.UI.Screens.Settings.PluginsTabView">
<Grid RowDefinitions="Auto,*" ColumnDefinitions="*,*" Width="900">
<TextBox Grid.Row="0" Grid.Column="0" Text="{Binding SearchPluginInput}" Watermark="Search plugins" Margin="0 10" />
<ScrollViewer Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">

View File

@ -1,7 +1,7 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public partial class PluginsTabView : ReactiveUserControl<PluginsTabViewModel>
{

View File

@ -16,7 +16,7 @@ using Artemis.UI.Shared.Services.Interfaces;
using Avalonia.Threading;
using ReactiveUI;
namespace Artemis.UI.Screens.Settings.Tabs
namespace Artemis.UI.Screens.Settings
{
public class PluginsTabViewModel : ActivatableViewModelBase
{

View File

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Sidebar.ContentDialogs.SidebarCategoryEditView">
x:Class="Artemis.UI.Screens.Sidebar.SidebarCategoryEditView">
<StackPanel>
<StackPanel.KeyBindings>
<KeyBinding Gesture="Enter" Command="{Binding Confirm}" />

View File

@ -3,7 +3,7 @@ using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using ReactiveUI;
namespace Artemis.UI.Screens.Sidebar.ContentDialogs
namespace Artemis.UI.Screens.Sidebar
{
public class SidebarCategoryEditView : ReactiveUserControl<SidebarCategoryEditViewModel>
{

View File

@ -6,7 +6,7 @@ using FluentAvalonia.UI.Controls;
using ReactiveUI;
using ReactiveUI.Validation.Extensions;
namespace Artemis.UI.Screens.Sidebar.ContentDialogs
namespace Artemis.UI.Screens.Sidebar
{
public class SidebarCategoryEditViewModel : ContentDialogViewModelBase
{

View File

@ -7,9 +7,9 @@
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:svg="clr-namespace:Avalonia.Svg.Skia;assembly=Avalonia.Svg.Skia"
xmlns:local="clr-namespace:Artemis.UI.Screens.Sidebar.Dialogs"
xmlns:local="clr-namespace:Artemis.UI.Screens.Sidebar"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="850"
x:Class="Artemis.UI.Screens.Sidebar.Dialogs.ProfileConfigurationEditView"
x:Class="Artemis.UI.Screens.Sidebar.ProfileConfigurationEditView"
Title="{Binding DisplayName}"
Icon="/Assets/Images/Logo/bow.ico"
Width="800"

View File

@ -2,7 +2,7 @@ using Avalonia;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Sidebar.Dialogs
namespace Artemis.UI.Screens.Sidebar
{
public partial class ProfileConfigurationEditView : ReactiveWindow<ProfileConfigurationEditViewModel>
{

View File

@ -15,7 +15,7 @@ using Material.Icons;
using Newtonsoft.Json;
using ReactiveUI;
namespace Artemis.UI.Screens.Sidebar.Dialogs
namespace Artemis.UI.Screens.Sidebar
{
public class ProfileConfigurationEditViewModel : DialogViewModelBase<bool>
{

View File

@ -1,7 +1,7 @@
using Artemis.UI.Shared;
using Material.Icons;
namespace Artemis.UI.Screens.Sidebar.Dialogs
namespace Artemis.UI.Screens.Sidebar
{
public class ProfileIconViewModel : ViewModelBase
{

View File

@ -2,7 +2,7 @@
using Artemis.UI.Shared;
using Material.Icons;
namespace Artemis.UI.Screens.Sidebar.Dialogs
namespace Artemis.UI.Screens.Sidebar
{
public class ProfileModuleViewModel : ViewModelBase
{

View File

@ -6,8 +6,6 @@ using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.Sidebar.ContentDialogs;
using Artemis.UI.Screens.Sidebar.Dialogs;
using Artemis.UI.Services;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;

View File

@ -1,7 +1,6 @@
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Screens.Sidebar.Dialogs;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces;

View File

@ -10,7 +10,6 @@ using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.Home;
using Artemis.UI.Screens.ProfileEditor;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Screens.Sidebar.ContentDialogs;
using Artemis.UI.Screens.SurfaceEditor;
using Artemis.UI.Screens.Workshop;
using Artemis.UI.Services;

View File

@ -8,107 +8,97 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.SurfaceEditor.SurfaceEditorView">
<paz:ZoomBorder Name="ZoomBorder"
Stretch="None"
ZoomSpeed="1.2"
ClipToBounds="True"
Focusable="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ZoomChanged="ZoomBorder_OnZoomChanged"
PointerPressed="ZoomBorder_OnPointerPressed"
PointerMoved="ZoomBorder_OnPointerMoved"
PointerReleased="ZoomBorder_OnPointerReleased">
<paz:ZoomBorder.Background>
<VisualBrush TileMode="Tile" Stretch="Uniform" SourceRect="0,0,25,25">
<VisualBrush.Visual>
<Grid Width="25" Height="25" RowDefinitions="*,*" ColumnDefinitions="*,*">
<Rectangle Grid.Row="0" Grid.Column="0" Fill="Black" Opacity="0.15" />
<Rectangle Grid.Row="0" Grid.Column="1" />
<Rectangle Grid.Row="1" Grid.Column="0" />
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Black" Opacity="0.15" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</paz:ZoomBorder.Background>
<Grid Name="ContainerGrid"
Background="Transparent">
<ItemsControl Items="{Binding SurfaceDeviceViewModels}" ClipToBounds="False">
<ItemsControl.Styles>
<Style Selector="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding Device.X}" />
<Setter Property="Canvas.Top" Value="{Binding Device.Y}" />
</Style>
</ItemsControl.Styles>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{Binding}">
<ContentControl.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Identify" Command="{Binding IdentifyDevice}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="AlarmLight" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-" />
<MenuItem Header="Bring to Front" Command="{Binding $parent[4].DataContext.BringToFront}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeBringToFront" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Bring Forward" Command="{Binding $parent[4].DataContext.BringForward}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeBringForward" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Send to Back" Command="{Binding $parent[4].DataContext.SendToBack}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeSendToBack" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Send Backward" Command="{Binding $parent[4].DataContext.SendBackward}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeSendBackward" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-" />
<MenuItem Header="Identify input"
Command="{Binding DetectInput}"
CommandParameter="{Binding Device}"
ToolTip.Tip="Teach Artemis which keypresses and/or button presses belong to this device">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="GestureDoubleTap" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="View properties" Command="{Binding ViewProperties}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Gear" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</ContentControl.ContextFlyout>
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Border Classes="router-container">
<paz:ZoomBorder Name="ZoomBorder"
Stretch="None"
ZoomSpeed="1.2"
ClipToBounds="True"
Focusable="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Background="{DynamicResource LargeCheckerboardBrush}"
ZoomChanged="ZoomBorder_OnZoomChanged"
PointerPressed="ZoomBorder_OnPointerPressed"
PointerMoved="ZoomBorder_OnPointerMoved"
PointerReleased="ZoomBorder_OnPointerReleased">
<Grid Name="ContainerGrid" Background="Transparent">
<ItemsControl Items="{Binding SurfaceDeviceViewModels}" ClipToBounds="False">
<ItemsControl.Styles>
<Style Selector="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding Device.X}" />
<Setter Property="Canvas.Top" Value="{Binding Device.Y}" />
</Style>
</ItemsControl.Styles>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{Binding}">
<ContentControl.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Identify" Command="{Binding IdentifyDevice}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="AlarmLight" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-" />
<MenuItem Header="Bring to Front" Command="{Binding $parent[4].DataContext.BringToFront}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeBringToFront" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Bring Forward" Command="{Binding $parent[4].DataContext.BringForward}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeBringForward" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Send to Back" Command="{Binding $parent[4].DataContext.SendToBack}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeSendToBack" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Send Backward" Command="{Binding $parent[4].DataContext.SendBackward}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="ArrangeSendBackward" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="-" />
<MenuItem Header="Identify input"
Command="{Binding DetectInput}"
CommandParameter="{Binding Device}"
ToolTip.Tip="Teach Artemis which keypresses and/or button presses belong to this device">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="GestureDoubleTap" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="View properties" Command="{Binding ViewProperties}" CommandParameter="{Binding Device}">
<MenuItem.Icon>
<avalonia:MaterialIcon Kind="Gear" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</ContentControl.ContextFlyout>
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<controls:SelectionRectangle Name="SelectionRectangle"
InputElement="{Binding #ZoomBorder}"
SelectionUpdated="{Binding UpdateSelection}" />
<controls:SelectionRectangle Name="SelectionRectangle"
InputElement="{Binding #ZoomBorder}"
SelectionUpdated="{Binding UpdateSelection}" />
<Border Name="SurfaceBounds"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Width="{Binding MaxTextureSize}"
Height="{Binding MaxTextureSize}"
BorderThickness="2"
BorderBrush="{DynamicResource SystemAccentColorDark3}"
CornerRadius="8" />
</Grid>
</paz:ZoomBorder>
<Border Name="SurfaceBounds"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Width="{Binding MaxTextureSize}"
Height="{Binding MaxTextureSize}"
BorderThickness="2"
BorderBrush="{DynamicResource SystemAccentColorDark3}"
CornerRadius="8" />
</Grid>
</paz:ZoomBorder>
</Border>
</UserControl>

View File

@ -11,10 +11,10 @@ namespace Artemis.UI.Screens.SurfaceEditor
{
public class SurfaceEditorView : ReactiveUserControl<SurfaceEditorViewModel>
{
private readonly SelectionRectangle _selectionRectangle;
private readonly Grid _containerGrid;
private readonly ZoomBorder _zoomBorder;
private readonly SelectionRectangle _selectionRectangle;
private readonly Border _surfaceBounds;
private readonly ZoomBorder _zoomBorder;
public SurfaceEditorView()
{
@ -25,8 +25,14 @@ namespace Artemis.UI.Screens.SurfaceEditor
_selectionRectangle = this.Find<SelectionRectangle>("SelectionRectangle");
_surfaceBounds = this.Find<Border>("SurfaceBounds");
_zoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
UpdateZoomBorderBackground();
}
((VisualBrush) _zoomBorder.Background).DestinationRect = new RelativeRect(_zoomBorder.OffsetX * -1, _zoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
private void ZoomBorderOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property.Name == nameof(_zoomBorder.Background))
UpdateZoomBorderBackground();
}
private void InitializeComponent()
@ -36,7 +42,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
private void ZoomBorder_OnZoomChanged(object sender, ZoomChangedEventArgs e)
{
((VisualBrush) _zoomBorder.Background).DestinationRect = new RelativeRect(_zoomBorder.OffsetX * -1, _zoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
UpdateZoomBorderBackground();
_selectionRectangle.BorderThickness = 1 / _zoomBorder.ZoomX;
_surfaceBounds.BorderThickness = new Thickness(2 / _zoomBorder.ZoomX);
}
@ -53,7 +59,9 @@ namespace Artemis.UI.Screens.SurfaceEditor
ViewModel?.StartMouseDrag(e.GetPosition(_containerGrid));
}
else
{
ViewModel?.ClearSelection();
}
}
private void ZoomBorder_OnPointerMoved(object? sender, PointerEventArgs e)
@ -61,7 +69,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
return;
if (ReferenceEquals(e.Pointer.Captured, sender))
if (ReferenceEquals(e.Pointer.Captured, sender))
ViewModel?.UpdateMouseDrag(e.GetPosition(_containerGrid));
}
@ -76,5 +84,11 @@ namespace Artemis.UI.Screens.SurfaceEditor
e.Pointer.Capture(null);
}
}
private void UpdateZoomBorderBackground()
{
if (_zoomBorder.Background is VisualBrush visualBrush)
visualBrush.DestinationRect = new RelativeRect(_zoomBorder.OffsetX * -1, _zoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
}
}
}

View File

@ -6,27 +6,28 @@
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Workshop.WorkshopView">
<StackPanel Margin="12">
<TextBlock>Workshop!! :3</TextBlock>
<Border Classes="card" Margin="0 12">
<StackPanel>
<TextBlock Classes="h4">Notification tests</TextBlock>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Informational}">
Notification test (default)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Warning}">
Notification test (warning)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Error}">
Notification test (error)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Success}">
Notification test (success)
</Button>
<Border Classes="router-container">
<StackPanel Margin="12">
<TextBlock>Workshop!! :3</TextBlock>
<Border Classes="card" Margin="0 12">
<StackPanel>
<TextBlock Classes="h4">Notification tests</TextBlock>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Informational}">
Notification test (default)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Warning}">
Notification test (warning)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Error}">
Notification test (error)
</Button>
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Success}">
Notification test (success)
</Button>
<controls:HotkeyBox Watermark="Some hotkey" Width="250" HorizontalAlignment="Left"></controls:HotkeyBox>
</StackPanel>
</Border>
</StackPanel>
<controls:HotkeyBox Watermark="Some hotkey" Width="250" HorizontalAlignment="Left" />
</StackPanel>
</Border>
</StackPanel>
</Border>
</UserControl>