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

Fixed remaining compile errors

This commit is contained in:
Robert 2023-03-31 20:52:38 +02:00
parent d171b947b7
commit 5b5acf2f76
96 changed files with 167 additions and 583 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<PreserveCompilationContext>false</PreserveCompilationContext>
<ShouldIncludeNativeSkiaSharp>false</ShouldIncludeNativeSkiaSharp>
<AssemblyTitle>Artemis.Core</AssemblyTitle>

View File

@ -6,7 +6,6 @@ using System.Linq;
using System.Reflection;
using Artemis.Core.JsonConverters;
using Artemis.Core.Services;
using Artemis.Core.Services.Core;
using Artemis.Core.SkiaSharp;
using Newtonsoft.Json;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
namespace Artemis.Core;

View File

@ -1,6 +1,5 @@
using System;
using EmbedIO;
using DryIoc;
namespace Artemis.Core.Services;

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<PreserveCompilationContext>false</PreserveCompilationContext>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -5,7 +5,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Avalonia.ReactiveUI;
using DryIoc;
using ReactiveUI;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>

View File

@ -1,7 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Avalonia.ReactiveUI;
using DryIoc;
using ReactiveUI;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputPath>bin\</OutputPath>
<Platforms>x64</Platforms>
@ -17,7 +17,7 @@
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview6" />
<PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview6" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.0.0-preview3" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.17" />

View File

@ -12,8 +12,6 @@ using Avalonia.Input;
using Avalonia.LogicalTree;
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Avalonia.Rendering;
using Avalonia.Threading;
namespace Artemis.UI.Shared;

View File

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Shared.EnumComboBox">
<ComboBox x:Name="EnumComboBox" HorizontalAlignment="Stretch">
<ComboBox x:Name="ChildEnumComboBox" HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding [1]}" />

View File

@ -90,7 +90,7 @@ public partial class EnumComboBox : UserControl
/// <inheritdoc />
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
{
_enumComboBox = this.Get<ComboBox>("EnumComboBox");
_enumComboBox = this.Get<ComboBox>("ChildEnumComboBox");
_enumComboBox.Items = _currentValues;
UpdateValues();

View File

@ -4,6 +4,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Media.Immutable;
using Avalonia.Styling;
using FluentAvalonia.UI.Media;
using FluentAvalonia.UI.Windowing;
using ReactiveUI;
@ -46,13 +47,9 @@ public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel> whe
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || !IsWindows11)
return;
// Enable Mica on Windows 11, based on the FluentAvalonia sample application
TransparencyBackgroundFallback = Brushes.Transparent;
TransparencyLevelHint = WindowTransparencyLevel.Mica;
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color) value! : new Color2(32, 32, 32);
color = color.LightenPercent(-0.5f);
Background = new ImmutableSolidColorBrush(color, 0.82);
TryEnableMicaEffect();
}
private void OnDataContextChanged(object? value)
@ -70,6 +67,31 @@ public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel> whe
else if (DataContext != value) DataContext = value;
}
private void TryEnableMicaEffect()
{
// The background colors for the Mica brush are still based around SolidBackgroundFillColorBase resource
// BUT since we can't control the actual Mica brush color, we have to use the window background to create
// the same effect. However, we can't use SolidBackgroundFillColorBase directly since its opaque, and if
// we set the opacity the color become lighter than we want. So we take the normal color, darken it and
// apply the opacity until we get the roughly the correct color
// NOTE that the effect still doesn't look right, but it suffices. Ideally we need access to the Mica
// CompositionBrush to properly change the color but I don't know if we can do that or not
if (ActualThemeVariant == ThemeVariant.Dark)
{
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", ThemeVariant.Dark, out object? value) ? (Color) value : new Color2(32, 32, 32);
color = color.LightenPercent(-0.5f);
Background = new ImmutableSolidColorBrush(color, 0.78);
}
else if (ActualThemeVariant == ThemeVariant.Light)
{
// Similar effect here
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", ThemeVariant.Light, out object? value) ? (Color) value : new Color2(243, 243, 243);
color = color.LightenPercent(0.5f);
Background = new ImmutableSolidColorBrush(color, 0.9);
}
}
/// <summary>
/// The ViewModel.

View File

@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia.Controls;

View File

@ -13,7 +13,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Avalonia.ReactiveUI;
using DryIoc;
using ReactiveUI;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.17763.0</TargetFramework>
<TargetFramework>net7.0-windows10.0.17763.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
<OutputPath>bin</OutputPath>

View File

@ -20,7 +20,7 @@ public static class UIContainerExtensions
public static void RegisterProviders(this IContainer container)
{
container.Register<ICursorProvider, CursorProvider>(Reuse.Singleton);
container.Register<IGraphicsContextProvider, GraphicsContextProvider>(Reuse.Singleton);
// container.Register<IGraphicsContextProvider, GraphicsContextProvider>(Reuse.Singleton);
container.Register<IAutoRunProvider, AutoRunProvider>();
container.Register<InputProvider, WindowsInputProvider>(serviceKey: WindowsInputProvider.Id);
container.Register<IUpdateNotificationProvider, WindowsUpdateNotificationProvider>();

View File

@ -2,7 +2,7 @@
"profiles": {
"Artemis.UI.Windows": {
"commandName": "Project",
"commandLineArgs": "--force-elevation --disable-forced-shutdown --pcmr"
"commandLineArgs": "--disable-forced-shutdown --pcmr"
}
}
}

View File

@ -1,25 +0,0 @@
using System;
using Avalonia.Win32;
namespace Artemis.UI.Windows.Providers.Input;
public class SpongeWindow : WindowImpl
{
public event EventHandler<SpongeWindowEventArgs>? WndProcCalled;
#region Overrides of WindowImpl
/// <inheritdoc />
protected override IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
OnWndProcCalled(new SpongeWindowEventArgs(hWnd, msg, wParam, lParam));
return base.WndProc(hWnd, msg, wParam, lParam);
}
#endregion
protected virtual void OnWndProcCalled(SpongeWindowEventArgs e)
{
WndProcCalled?.Invoke(this, e);
}
}

View File

@ -1,19 +0,0 @@
using System;
namespace Artemis.UI.Windows.Providers.Input;
public class SpongeWindowEventArgs : EventArgs
{
public SpongeWindowEventArgs(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
HWnd = hWnd;
Msg = msg;
WParam = wParam;
LParam = lParam;
}
public IntPtr HWnd { get; }
public uint Msg { get; }
public IntPtr WParam { get; }
public IntPtr LParam { get; }
}

View File

@ -5,6 +5,8 @@ using System.Timers;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Windows.Utilities;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Platform;
using Linearstar.Windows.RawInput;
using Linearstar.Windows.RawInput.Native;
using Serilog;
@ -17,7 +19,6 @@ public class WindowsInputProvider : InputProvider
private readonly IInputService _inputService;
private readonly ILogger _logger;
private readonly SpongeWindow _sponge;
private readonly Timer _taskManagerTimer;
private int _lastProcessId;
@ -26,15 +27,23 @@ public class WindowsInputProvider : InputProvider
_logger = logger;
_inputService = inputService;
_sponge = new SpongeWindow();
_sponge.WndProcCalled += SpongeOnWndProcCalled;
_taskManagerTimer = new Timer(500);
_taskManagerTimer.Elapsed += TaskManagerTimerOnElapsed;
_taskManagerTimer.Start();
RawInputDevice.RegisterDevice(HidUsageAndPage.Keyboard, RawInputDeviceFlags.InputSink, _sponge.Handle.Handle);
RawInputDevice.RegisterDevice(HidUsageAndPage.Mouse, RawInputDeviceFlags.InputSink, _sponge.Handle.Handle);
// if (Avalonia.Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
// {
// IWindowImpl window = desktop.MainWindow!.PlatformImpl!;
//
// // https://github.com/sanjay900/guitar-configurator/blob/master/Notify/WindowsDeviceNotifierAvalonia.cs
// // _hWndProcHook = GetWindowLongPtr(window.Handle.Handle, GwlWndproc);
// // _fnWndProcHook = CustomWndProc;
// // var newLong = Marshal.GetFunctionPointerForDelegate(_fnWndProcHook);
// // SetWindowLongPtr(window.Handle.Handle, GwlWndproc, newLong);
//
// RawInputDevice.RegisterDevice(HidUsageAndPage.Keyboard, RawInputDeviceFlags.InputSink, window.Handle.Handle);
// RawInputDevice.RegisterDevice(HidUsageAndPage.Mouse, RawInputDeviceFlags.InputSink, window.Handle.Handle);
// }
}
public static Guid Id { get; } = new("6737b204-ffb1-4cd9-8776-9fb851db303a");
@ -55,19 +64,18 @@ public class WindowsInputProvider : InputProvider
{
if (disposing)
{
_sponge.Dispose();
_taskManagerTimer.Dispose();
}
base.Dispose(disposing);
}
private void SpongeOnWndProcCalled(object? sender, SpongeWindowEventArgs message)
private void OnWndProcCalled(nint hWnd, uint msg, nint wParam, nint lParam)
{
if (message.Msg != WM_INPUT)
if (msg != WM_INPUT)
return;
RawInputData data = RawInputData.FromHandle(message.LParam);
RawInputData data = RawInputData.FromHandle(lParam);
switch (data)
{
case RawInputMouseData mouse:

View File

@ -9,7 +9,6 @@ using Artemis.UI.Screens.Settings;
using Artemis.UI.Services.Updating;
using Artemis.UI.Shared.Services.MainWindow;
using Avalonia.Threading;
using DryIoc.ImTools;
using Microsoft.Toolkit.Uwp.Notifications;
using ReactiveUI;

View File

@ -1,5 +1,6 @@
using System;
using System.Linq;
using Avalonia.Controls;
using Avalonia.Win32;
using SharpVk;
using SharpVk.Khronos;
@ -10,10 +11,10 @@ internal sealed class Win32VkContext : VkContext
{
public Win32VkContext()
{
Window = new WindowImpl();
Window = new Window();
Instance = Instance.Create(null, new[] {"VK_KHR_surface", "VK_KHR_win32_surface"});
PhysicalDevice = Instance.EnumeratePhysicalDevices().First();
Surface = Instance.CreateWin32Surface(Kernel32.CurrentModuleHandle, Window.Handle.Handle);
Surface = Instance.CreateWin32Surface(Kernel32.CurrentModuleHandle, Window.PlatformImpl!.Handle.Handle);
(GraphicsFamily, PresentFamily) = FindQueueFamilies();
@ -43,12 +44,12 @@ internal sealed class Win32VkContext : VkContext
};
}
public WindowImpl Window { get; }
public Window Window { get; }
public override void Dispose()
{
base.Dispose();
Window.Dispose();
Window.Close();
}
private IntPtr Proc(string name, IntPtr instanceHandle, IntPtr deviceHandle)

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputPath>bin/</OutputPath>
<Platforms>x64</Platforms>
@ -29,8 +29,8 @@
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview6" />
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Live.Avalonia" Version="1.3.1" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="0.10.13" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.0-b1" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.0.0-preview3" />
<PackageReference Include="Octopus.Octodiff" Version="2.0.100" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />

View File

@ -1,8 +1,9 @@
<controls:CoreWindow xmlns="https://github.com/avaloniaui"
<windowing:AppWindow 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:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.MainWindow"
Icon="/Assets/Images/Logo/application.ico"
@ -26,4 +27,4 @@
</DockPanel>
<StackPanel Classes="notification-container" Name="NotificationContainer" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
</Panel>
</controls:CoreWindow>
</windowing:AppWindow>

View File

@ -7,13 +7,12 @@ using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using FluentAvalonia.Core.ApplicationModel;
using Avalonia.ReactiveUI;
using ReactiveUI;
namespace Artemis.UI;
public class MainWindow : ReactiveAppWindow<RootViewModel>
public partial class MainWindow : ReactiveAppWindow<RootViewModel>
{
private readonly Panel _rootPanel;
private readonly ContentControl _sidebarContentControl;
@ -25,7 +24,7 @@ public class MainWindow : ReactiveAppWindow<RootViewModel>
Activated += OnActivated;
Deactivated += OnDeactivated;
ApplyWindowSize();
// ApplyWindowSize();
InitializeComponent();
_rootPanel = this.Get<Panel>("RootPanel");
@ -67,12 +66,12 @@ public class MainWindow : ReactiveAppWindow<RootViewModel>
private void OnOpened(object? sender, EventArgs e)
{
Opened -= OnOpened;
ICoreApplicationView coreAppTitleBar = this;
if (coreAppTitleBar.TitleBar != null)
{
coreAppTitleBar.TitleBar.ExtendViewIntoTitleBar = true;
SetTitleBar(this.Get<Border>("DragHandle"));
}
// ICoreApplicationView coreAppTitleBar = this;
// if (coreAppTitleBar.TitleBar != null)
// {
// coreAppTitleBar.TitleBar.ExtendViewIntoTitleBar = true;
// SetTitleBar(this.Get<Border>("DragHandle"));
// }
}
private void OnActivated(object? sender, EventArgs e)

View File

@ -9,7 +9,6 @@
<TextBlock Classes="subtitle" Text="{Binding Profiler.Name}" Margin="10 10 0 0" />
<DataGrid Items="{Binding Measurements}"
d:DataContext="{d:DesignInstance Type={x:Type local:PerformanceDebugMeasurementViewModel}}"
CanUserSortColumns="True"
IsReadOnly="True"
AutoGenerateColumns="False"

View File

@ -117,7 +117,7 @@
</controls:HyperlinkButton>
<TextBlock Grid.Row="1"
Grid.Column="1"
Foreground="{DynamicResource MaterialDesignBodyLight}"
Classes="subtitle"
TextWrapping="Wrap"
VerticalAlignment="Center">
Feel like making a donation? It would be gratefully received. Click the button to donate via PayPal.

View File

@ -18,7 +18,7 @@
<TextBlock Text=" - " />
<TextBlock Text="{CompiledBinding ActiveAction.Action.Name, Mode=OneWay, FallbackValue=''}" />
</StackPanel>
<TextBlock Foreground="{DynamicResource MaterialDesignBodyLight}" TextWrapping="Wrap" IsVisible="{CompiledBinding Actions.Count}">
<TextBlock Classes="subtitle" TextWrapping="Wrap" IsVisible="{CompiledBinding Actions.Count}">
</TextBlock>
<TextBlock Classes="h4" TextWrapping="Wrap" Text="{CompiledBinding ActiveAction.Action.Name, Mode=OneWay}" IsVisible="{CompiledBinding !Actions.Count}" />

View File

@ -1,5 +1,4 @@
using System;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -13,7 +13,6 @@ using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.Builders;
using Avalonia.Controls;
using Avalonia.Threading;
using DryIoc;
using Material.Icons;
using ReactiveUI;

View File

@ -3,7 +3,6 @@ using System.Collections.ObjectModel;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.VisualTree;

View File

@ -1,6 +1,5 @@
using System;
using System.Reactive.Disposables;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;

View File

@ -1,6 +1,5 @@
using System;
using System.Reactive.Disposables;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;

View File

@ -23,8 +23,8 @@
<converters:ColorOpacityConverter x:Key="ColorOpacityConverter" />
</UserControl.Resources>
<UserControl.Styles>
<StyleInclude Source="avares://Avalonia.Xaml.Interactions/Draggable/Styles.axaml" />
<Style Selector="TreeView#ProfileTreeView">
<StyleInclude Source="avares://Avalonia.Xaml.Interactions.Draggable/Styles.axaml" />
<Style Selector="TreeView#Profile">
<Style.Resources>
<profileBehaviors:ProfileTreeViewDropHandler x:Key="ProfileTreeViewDropHandler" />
</Style.Resources>
@ -37,7 +37,7 @@
</Setter>
</Style>
<Style Selector="TreeView#ProfileTreeView TreeViewItem">
<Style Selector="TreeView#Profile TreeViewItem">
<Setter Property="IsExpanded" Value="True" />
<Setter Property="(Interaction.Behaviors)">
<BehaviorCollectionTemplate>
@ -48,7 +48,7 @@
</Setter>
</Style>
<Style Selector="TreeView#ProfileTreeView TreeViewItem:dragging-before">
<Style Selector="TreeView#Profile TreeViewItem:dragging-before">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,28">
@ -60,7 +60,7 @@
</Setter.Value>
</Setter>
</Style>
<Style Selector="TreeView#ProfileTreeView TreeViewItem:dragging-into">
<Style Selector="TreeView#Profile TreeViewItem:dragging-into">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,28">
@ -76,7 +76,7 @@
</Setter.Value>
</Setter>
</Style>
<Style Selector="TreeView#ProfileTreeView TreeViewItem:dragging-after">
<Style Selector="TreeView#Profile TreeViewItem:dragging-after">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,28">
@ -90,7 +90,7 @@
</Style>
</UserControl.Styles>
<Grid RowDefinitions="*,Auto">
<TreeView Name="ProfileTreeView" Classes="no-right-margin draggable"
<TreeView Name="Profile" Classes="no-right-margin draggable"
Items="{CompiledBinding Children}"
SelectedItem="{CompiledBinding SelectedChild}"
SelectionChanged="ProfileTreeView_OnSelectionChanged">

View File

@ -120,6 +120,6 @@ public partial class ProfileTreeView : ReactiveUserControl<ProfileTreeViewModel>
private void ProfileTreeView_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
ProfileTreeView.Focus();
Profile.Focus();
}
}

View File

@ -1,5 +1,3 @@
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,5 +1,3 @@
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,5 +1,3 @@
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -5,7 +5,6 @@ using Artemis.Core;
using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;

View File

@ -12,7 +12,6 @@ using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.Builders;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;

View File

@ -1,11 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Events;
using Artemis.UI.Shared.Extensions;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -6,7 +6,6 @@ using Artemis.Core;
using Artemis.UI.Shared.Extensions;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Controls.Shapes;
using Avalonia.Input;

View File

@ -2,9 +2,7 @@ using System;
using System.Linq;
using System.Reactive.Disposables;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Controls.Shapes;
using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,9 +1,7 @@
using System;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Controls.Shapes;
using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor;

View File

@ -8,8 +8,7 @@
xmlns:shared="clr-namespace:Artemis.UI.Shared.Services.ProfileEditor;assembly=Artemis.UI.Shared"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileEditorView"
x:DataType="profileEditor:ProfileEditorViewModel"
Name="ProfileEditorView">
x:DataType="profileEditor:ProfileEditorViewModel">
<UserControl.Resources>
<converters:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter" />
</UserControl.Resources>

View File

@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -29,7 +29,7 @@
<TextBlock Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Top"
Foreground="{DynamicResource MaterialDesignBodyLight}"
Classes="subtitle"
Text="{Binding Version}" />
<controls:HyperlinkButton Grid.Row="1"

View File

@ -157,166 +157,7 @@
<Separator Grid.Row="1" Classes="card-separator" />
<avalonia:MarkdownScrollViewer Grid.Row="2" Markdown="{CompiledBinding Changelog}">
<avalonia:MarkdownScrollViewer.Styles>
<Style Selector="ctxt|CTextBlock">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1}" />
<Setter Property="Margin" Value="0,5" />
</Style.Setters>
</Style>
<Style Selector="TextBlock">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading1">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 3.2}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading2">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.6}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading3">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.6}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading4">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.2}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CHyperlink">
<Style.Setters>
<Setter Property="IsUnderline" Value="true" />
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CHyperlink:pointerover">
<Setter Property="Foreground" Value="{mde:Complementary SystemAccentColor}" />
</Style>
<Style Selector="Border.Table">
<Style.Setters>
<Setter Property="Margin" Value="5" />
<Setter Property="BorderThickness" Value="0,0,1,1" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
</Style.Setters>
</Style>
<Style Selector="Grid.Table > Border">
<Style.Setters>
<Setter Property="Margin" Value="0" />
<Setter Property="BorderThickness" Value="1,1,0,0" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="Padding" Value="2" />
</Style.Setters>
</Style>
<Style Selector="Border.TableHeader">
<Style.Setters>
<Setter Property="Background" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.3}" />
</Style.Setters>
</Style>
<Style Selector="Border.TableHeader ctxt|CTextBlock">
<Style.Setters>
<Setter Property="FontWeight" Value="DemiBold" />
</Style.Setters>
</Style>
<Style Selector="Border.EvenTableRow">
<Style.Setters>
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="Border.CodeBlock">
<Style.Setters>
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="0,5,0,5" />
<Setter Property="Margin" Value="5,0,5,0" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="TextBlock.CodeBlock">
<Style.Setters>
<Setter Property="FontFamily" Value="menlo,monaco,consolas,droid sans mono,inconsolata,courier new,monospace,dejavu sans mono" />
<Setter Property="Foreground" Value="{mde:DivideColor Blue, TextFillColorPrimary, 0.4}" />
</Style.Setters>
</Style>
<Style Selector="Border.NoContainer">
<Style.Setters>
<Setter Property="BorderBrush" Value="Red" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CCode">
<Style.Setters>
<Setter Property="Foreground" Value="{mde:DivideColor Blue, TextFillColorPrimary, 0.4}" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="Border.Note">
<Style.Setters>
<Setter Property="Margin" Value="5,0,5,0" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="3,3,3,3" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Note">
<Style.Setters>
<Setter Property="Margin" Value="10, 5" />
</Style.Setters>
</Style>
<Style Selector="Grid.List">
<Style.Setters>
<Setter Property="Margin" Value="15,0,0,0" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.ListMarker">
<Style.Setters>
<Setter Property="Margin" Value="0,5,5,5" />
</Style.Setters>
</Style>
<Style Selector="Border.Blockquote">
<Style.Setters>
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="5,0,0,0" />
</Style.Setters>
</Style>
<Style Selector="StackPanel.Blockquote">
<Style.Setters>
<Setter Property="Margin" Value="10, 5" />
</Style.Setters>
</Style>
<Style Selector="mdc|Rule">
<Style.Setters>
<Setter Property="Margin" Value="0,3" />
</Style.Setters>
</Style>
</avalonia:MarkdownScrollViewer.Styles>
</avalonia:MarkdownScrollViewer>
</Grid>
</Border>

View File

@ -1,6 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Input;
using Avalonia.VisualTree;
using Avalonia.Xaml.Interactions.DragAndDrop;

View File

@ -2,7 +2,6 @@ using System;
using System.Reactive.Disposables;
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using ReactiveUI;

View File

@ -9,15 +9,12 @@
x:Class="Artemis.UI.Screens.Sidebar.SidebarView"
x:DataType="sidebar:SidebarViewModel">
<UserControl.Styles>
<StyleInclude Source="avares://Avalonia.Xaml.Interactions/Draggable/Styles.axaml" />
<StyleInclude Source="avares://Avalonia.Xaml.Interactions.Draggable/Styles.axaml" />
</UserControl.Styles>
<Grid RowDefinitions="60,Auto,Auto,*,Auto,Auto">
<Grid Grid.Row="0" IsHitTestVisible="False" ColumnDefinitions="Auto,*">
<Image Grid.Column="0" Margin="12" Source="/Assets/Images/Logo/bow.png" RenderOptions.BitmapInterpolationMode="HighQuality" />
<TextBlock Grid.Column="1"
FontSize="24"
VerticalAlignment="Center"
Foreground="{DynamicResource MaterialDesignDarkForeground}">
<TextBlock Grid.Column="1" FontSize="24" VerticalAlignment="Center">
Artemis 2
</TextBlock>
</Grid>

View File

@ -3,9 +3,7 @@ using System.Reactive.Disposables;
using Artemis.UI.Screens.StartupWizard.Steps;
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Navigation;
using ReactiveUI;

View File

@ -3,15 +3,12 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reflection;
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.DeviceProviders;
using Artemis.Core.Services;
using Artemis.UI.DryIoc.Factories;
using Artemis.UI.Screens.Plugins;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Services.Updating;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Providers;
using Artemis.UI.Shared.Services;

View File

@ -30,7 +30,7 @@
<TextBlock Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Top"
Foreground="{DynamicResource MaterialDesignBodyLight}"
Classes="subtitle"
Text="{Binding Version}" />
<controls:HyperlinkButton Grid.Row="1"

View File

@ -64,7 +64,7 @@
</UserControl.Resources>
<Grid Margin="0 0 15 15" ColumnDefinitions="*,400">
<Border Grid.Column="0" Classes="card-condensed">
<paz:ZoomBorder Name="ZoomBorder"
<paz:ZoomBorder Name="ContainerZoomBorder"
Stretch="None"
ClipToBounds="True"
Focusable="True"

View File

@ -1,10 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Events;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
@ -18,7 +16,7 @@ public partial class SurfaceEditorView : ReactiveUserControl<SurfaceEditorViewMo
public SurfaceEditorView()
{
InitializeComponent();
ZoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
ContainerZoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
UpdateZoomBorderBackground();
}
@ -36,7 +34,7 @@ public partial class SurfaceEditorView : ReactiveUserControl<SurfaceEditorViewMo
private void ZoomBorder_OnZoomChanged(object sender, ZoomChangedEventArgs e)
{
UpdateZoomBorderBackground();
SurfaceBounds.BorderThickness = new Thickness(2 / ZoomBorder.ZoomX);
SurfaceBounds.BorderThickness = new Thickness(2 / ContainerZoomBorder.ZoomX);
}
private void SelectionRectangle_OnSelectionUpdated(object? sender, SelectionRectangleEventArgs e)
@ -54,7 +52,7 @@ public partial class SurfaceEditorView : ReactiveUserControl<SurfaceEditorViewMo
private void UpdateZoomBorderBackground()
{
if (ZoomBorder.Background is VisualBrush visualBrush)
visualBrush.DestinationRect = new RelativeRect(ZoomBorder.OffsetX * -1, ZoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
if (ContainerZoomBorder.Background is VisualBrush visualBrush)
visualBrush.DestinationRect = new RelativeRect(ContainerZoomBorder.OffsetX * -1, ContainerZoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
}
}

View File

@ -3,8 +3,6 @@ using System.Linq;
using System.Reactive.Disposables;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.Media;

View File

@ -2,9 +2,6 @@ using System;
using System.Linq;
using System.Reactive.Disposables;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.Shapes;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.ReactiveUI;

View File

@ -3,8 +3,6 @@ using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Input;
using Avalonia.LogicalTree;

View File

@ -35,7 +35,7 @@
<KeyBinding Command="{CompiledBinding History.Undo}" Gesture="Ctrl+Z" />
<KeyBinding Command="{CompiledBinding History.Redo}" Gesture="Ctrl+Y" />
</UserControl.KeyBindings>
<paz:ZoomBorder Name="ZoomBorder"
<paz:ZoomBorder Name="NodeScriptZoomBorder"
Stretch="None"
Focusable="True"
VerticalAlignment="Stretch"
@ -86,7 +86,7 @@
</ItemsControl>
<shared:SelectionRectangle Name="SelectionRectangle"
InputElement="{Binding #ZoomBorder}"
InputElement="{Binding #NodeScriptZoomBorder}"
SelectionUpdated="SelectionRectangle_OnSelectionUpdated"
SelectionFinished="SelectionRectangle_OnSelectionFinished"
BorderBrush="{DynamicResource SystemAccentColor}"

View File

@ -2,11 +2,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Events;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Controls.PanAndZoom;
using Avalonia.Input;
using Avalonia.Interactivity;
@ -25,26 +23,26 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
{
InitializeComponent();
ZoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
UpdateZoomBorderBackground();
ZoomBorder.AddHandler(PointerReleasedEvent, CanvasOnPointerReleased, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
ZoomBorder.AddHandler(PointerWheelChangedEvent, ZoomOnPointerWheelChanged, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
ZoomBorder.AddHandler(PointerMovedEvent, ZoomOnPointerMoved, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
this.WhenActivated(d =>
{
ViewModel!.AutoFitRequested += ViewModelOnAutoFitRequested;
ViewModel.PickerPositionSubject.Subscribe(ShowPickerAt).DisposeWith(d);
if (ViewModel.IsPreview)
{
BoundsProperty.Changed.Subscribe(BoundsPropertyChanged).DisposeWith(d);
ViewModel.NodeViewModels.ToObservableChangeSet().Subscribe(_ => AutoFitIfPreview()).DisposeWith(d);
}
Dispatcher.UIThread.InvokeAsync(() => AutoFit(true), DispatcherPriority.ContextIdle);
Disposable.Create(() => ViewModel.AutoFitRequested -= ViewModelOnAutoFitRequested).DisposeWith(d);
});
// NodeScriptZoomBorder.PropertyChanged += ZoomBorderOnPropertyChanged;
// UpdateZoomBorderBackground();
//
// NodeScriptZoomBorder.AddHandler(PointerReleasedEvent, CanvasOnPointerReleased, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
// NodeScriptZoomBorder.AddHandler(PointerWheelChangedEvent, ZoomOnPointerWheelChanged, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
// NodeScriptZoomBorder.AddHandler(PointerMovedEvent, ZoomOnPointerMoved, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
//
// this.WhenActivated(d =>
// {
// ViewModel!.AutoFitRequested += ViewModelOnAutoFitRequested;
// ViewModel.PickerPositionSubject.Subscribe(ShowPickerAt).DisposeWith(d);
// if (ViewModel.IsPreview)
// {
// BoundsProperty.Changed.Subscribe(BoundsPropertyChanged).DisposeWith(d);
// ViewModel.NodeViewModels.ToObservableChangeSet().Subscribe(_ => AutoFitIfPreview()).DisposeWith(d);
// }
//
// Dispatcher.UIThread.InvokeAsync(() => AutoFit(true), DispatcherPriority.ContextIdle);
// Disposable.Create(() => ViewModel.AutoFitRequested -= ViewModelOnAutoFitRequested).DisposeWith(d);
// });
}
protected override Size MeasureOverride(Size availableSize)
@ -56,7 +54,7 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
private void ZoomOnPointerWheelChanged(object? sender, PointerWheelEventArgs e)
{
// If scroll events aren't handled here the ZoomBorder does some random panning when at the zoom limit
if (e.Delta.Y > 0 && ZoomBorder.ZoomX >= 1)
if (e.Delta.Y > 0 && NodeScriptZoomBorder.ZoomX >= 1)
e.Handled = true;
}
@ -71,7 +69,7 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
if (ViewModel == null)
return;
ViewModel.NodePickerViewModel.Position = point;
ZoomBorder?.ContextFlyout?.ShowAt(ZoomBorder);
NodeScriptZoomBorder?.ContextFlyout?.ShowAt(NodeScriptZoomBorder);
}
private void AutoFitIfPreview()
@ -111,8 +109,8 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
double scale = Math.Min(1, Math.Min(Bounds.Width / scriptRect.Width, Bounds.Height / scriptRect.Height));
// Pan and zoom to make the script fit
ZoomBorder.Zoom(scale, 0, 0, skipTransitions);
ZoomBorder.Pan(Bounds.Center.X - scriptRect.Center.X * scale, Bounds.Center.Y - scriptRect.Center.Y * scale, skipTransitions);
NodeScriptZoomBorder.Zoom(scale, 0, 0, skipTransitions);
NodeScriptZoomBorder.Pan(Bounds.Center.X - scriptRect.Center.X * scale, Bounds.Center.Y - scriptRect.Center.Y * scale, skipTransitions);
}
private void ViewModelOnAutoFitRequested(object? sender, EventArgs e)
@ -122,14 +120,14 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
private void ZoomBorderOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property.Name == nameof(ZoomBorder.Background))
if (e.Property.Name == nameof(NodeScriptZoomBorder.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);
if (NodeScriptZoomBorder.Background is VisualBrush visualBrush)
visualBrush.DestinationRect = new RelativeRect(NodeScriptZoomBorder.OffsetX * -1, NodeScriptZoomBorder.OffsetY * -1, 20, 20, RelativeUnit.Absolute);
}
private void InitializeComponent()
@ -140,7 +138,7 @@ public partial class NodeScriptView : ReactiveUserControl<NodeScriptViewModel>
private void ZoomBorder_OnZoomChanged(object sender, ZoomChangedEventArgs e)
{
if (ViewModel != null)
ViewModel.PanMatrix = ZoomBorder.Matrix;
ViewModel.PanMatrix = NodeScriptZoomBorder.Matrix;
UpdateZoomBorderBackground();
}

View File

@ -5,7 +5,6 @@ using System.Threading;
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Storage.Entities.General;
using Artemis.Storage.Repositories;
using Artemis.UI.Exceptions;
using Artemis.UI.Shared.Services.MainWindow;
@ -110,6 +109,9 @@ public class UpdateService : IUpdateService
private async void HandleAutoUpdateEvent(object? sender, EventArgs e)
{
if (Constants.CurrentVersion == "local")
return;
// The event can trigger from multiple sources with a timer acting as a fallback, only actual perform an action once per max 59 minutes
if (DateTime.UtcNow - _lastAutoUpdateCheck < TimeSpan.FromMinutes(59))
return;
@ -204,6 +206,9 @@ public class UpdateService : IUpdateService
/// <inheritdoc />
public bool Initialize()
{
if (Constants.CurrentVersion == "local")
return false;
string? channelArgument = Constants.StartupArguments.FirstOrDefault(a => a.StartsWith("--channel="));
if (channelArgument != null)
Channel = channelArgument.Split("=")[1];

View File

@ -1,10 +1,11 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styling="clr-namespace:FluentAvalonia.Styling;assembly=FluentAvalonia">
xmlns:styling="clr-namespace:FluentAvalonia.Styling;assembly=FluentAvalonia"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia">
<!-- Third party styles -->
<styling:FluentAvaloniaTheme PreferSystemTheme="False" RequestedTheme="Dark"/>
<avalonia:MaterialIconStyles />
<!-- <FluentTheme Mode="Dark"></FluentTheme> -->
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" />
<StyleInclude Source="avares://Artemis.UI.Shared/Styles/Artemis.axaml" />
<StyleInclude Source="avares://Artemis.UI/Styles/Markdown.axaml" />
</Styles>

View File

@ -1,191 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonia="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia"
xmlns:mdc="clr-namespace:Markdown.Avalonia.Controls;assembly=Markdown.Avalonia"
xmlns:mde="clr-namespace:Markdown.Avalonia.Extensions;assembly=Markdown.Avalonia"
xmlns:ctxt="clr-namespace:ColorTextBlock.Avalonia;assembly=ColorTextBlock.Avalonia">
<Design.PreviewWith>
<Border Padding="20">
<avalonia:MarkdownScrollViewer Classes="Test">
<avalonia:MarkdownScrollViewer.Styles>
<Style Selector="ctxt|CTextBlock">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1}" />
<Setter Property="Margin" Value="0,5" />
</Style.Setters>
</Style>
<Style Selector="TextBlock">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading1">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 3.2}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading2">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.6}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading3">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.6}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Heading4">
<Style.Setters>
<Setter Property="FontSize" Value="{mde:Multiply ControlContentThemeFontSize, 1.2}" />
<Setter Property="Foreground" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="FontWeight" Value="Light" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CHyperlink">
<Style.Setters>
<Setter Property="IsUnderline" Value="true" />
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CHyperlink:pointerover">
<Setter Property="Foreground" Value="{mde:Complementary SystemAccentColor}" />
</Style>
<Style Selector="Border.Table">
<Style.Setters>
<Setter Property="Margin" Value="5" />
<Setter Property="BorderThickness" Value="0,0,1,1" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
</Style.Setters>
</Style>
<Style Selector="Grid.Table > Border">
<Style.Setters>
<Setter Property="Margin" Value="0" />
<Setter Property="BorderThickness" Value="1,1,0,0" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.7}" />
<Setter Property="Padding" Value="2" />
</Style.Setters>
</Style>
<Style Selector="Border.TableHeader">
<Style.Setters>
<Setter Property="Background" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.3}" />
</Style.Setters>
</Style>
<Style Selector="Border.TableHeader ctxt|CTextBlock">
<Style.Setters>
<Setter Property="FontWeight" Value="DemiBold" />
</Style.Setters>
</Style>
<Style Selector="Border.EvenTableRow">
<Style.Setters>
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="Border.CodeBlock">
<Style.Setters>
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="0,5,0,5" />
<Setter Property="Margin" Value="5,0,5,0" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="TextBlock.CodeBlock">
<Style.Setters>
<Setter Property="FontFamily" Value="menlo,monaco,consolas,droid sans mono,inconsolata,courier new,monospace,dejavu sans mono" />
<Setter Property="Foreground" Value="{mde:DivideColor Blue, TextFillColorPrimary, 0.4}" />
</Style.Setters>
</Style>
<Style Selector="Border.NoContainer">
<Style.Setters>
<Setter Property="BorderBrush" Value="Red" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CCode">
<Style.Setters>
<Setter Property="Foreground" Value="{mde:DivideColor Blue, TextFillColorPrimary, 0.4}" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="Border.Note">
<Style.Setters>
<Setter Property="Margin" Value="5,0,5,0" />
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="3,3,3,3" />
<Setter Property="Background" Value="{mde:Alpha ControlFillColorDefaultBrush, 0.9}" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.Note">
<Style.Setters>
<Setter Property="Margin" Value="10, 5" />
</Style.Setters>
</Style>
<Style Selector="Grid.List">
<Style.Setters>
<Setter Property="Margin" Value="15,0,0,0" />
</Style.Setters>
</Style>
<Style Selector="ctxt|CTextBlock.ListMarker">
<Style.Setters>
<Setter Property="Margin" Value="0,5,5,5" />
</Style.Setters>
</Style>
<Style Selector="Border.Blockquote">
<Style.Setters>
<Setter Property="BorderBrush" Value="{mde:Alpha TextFillColorPrimaryBrush, 0.2}" />
<Setter Property="BorderThickness" Value="5,0,0,0" />
</Style.Setters>
</Style>
<Style Selector="StackPanel.Blockquote">
<Style.Setters>
<Setter Property="Margin" Value="10, 5" />
</Style.Setters>
</Style>
<Style Selector="mdc|Rule">
<Style.Setters>
<Setter Property="Margin" Value="0,3" />
</Style.Setters>
</Style>
</avalonia:MarkdownScrollViewer.Styles>
## Core
* Cleaned up ProfileService render condition
* Core - Added fading in and out of profiles
* Core - Apply opacity layer only when fading
* Core - Fixed when condition stops being true mid-fade
* Core - Removed FadingStatus enum
# General
- Meta - Fixed warnings
- Meta - Update RGB.NET
# Plugins
- Plugins - Ignore version when loading shared assemblies
# UI
- Sidebar - Improved category reordering code
</avalonia:MarkdownScrollViewer>
</Border>
</Design.PreviewWith>
</Styles>

View File

@ -11,7 +11,7 @@ namespace Artemis.UI;
public class ViewLocator : IDataTemplate
{
public IControl Build(object data)
public Control Build(object data)
{
Type dataType = data.GetType();
string name = dataType.FullName!.Split('`')[0].Replace("ViewModel", "View");

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Color.Screens;
public class ColorGradientNodeCustomView : ReactiveUserControl<ColorGradientNodeCustomViewModel>
public partial class ColorGradientNodeCustomView : ReactiveUserControl<ColorGradientNodeCustomViewModel>
{
public ColorGradientNodeCustomView()
{

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Color.Screens;
public class RampSKColorNodeCustomView : ReactiveUserControl<RampSKColorNodeCustomViewModel>
public partial class RampSKColorNodeCustomView : ReactiveUserControl<RampSKColorNodeCustomViewModel>
{
public RampSKColorNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.DataModel.Screens;
public class DataModelEventCycleNodeCustomView : ReactiveUserControl<DataModelEventCycleNodeCustomViewModel>
public partial class DataModelEventCycleNodeCustomView : ReactiveUserControl<DataModelEventCycleNodeCustomViewModel>
{
public DataModelEventCycleNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.DataModel.Screens;
public class DataModelEventNodeCustomView : ReactiveUserControl<DataModelEventNodeCustomViewModel>
public partial class DataModelEventNodeCustomView : ReactiveUserControl<DataModelEventNodeCustomViewModel>
{
public DataModelEventNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.DataModel.Screens;
public class DataModelNodeCustomView : ReactiveUserControl<DataModelNodeCustomViewModel>
public partial class DataModelNodeCustomView : ReactiveUserControl<DataModelNodeCustomViewModel>
{
public DataModelNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.External.Screens;
public class LayerPropertyNodeCustomView : ReactiveUserControl<LayerPropertyNodeCustomViewModel>
public partial class LayerPropertyNodeCustomView : ReactiveUserControl<LayerPropertyNodeCustomViewModel>
{
public LayerPropertyNodeCustomView()
{

View File

@ -1,10 +1,10 @@
using System.Collections.ObjectModel;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.VisualScripting;
using Artemis.VisualScripting.Nodes.External.Commands;
using Avalonia.Controls.Mixins;
using DynamicData;
using ReactiveUI;

View File

@ -1,6 +1,4 @@
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,9 +1,9 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Input.Screens;

View File

@ -1,6 +1,4 @@
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,9 +1,9 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Input.Screens;

View File

@ -1,6 +1,4 @@
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;

View File

@ -1,9 +1,9 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Input.Screens;

View File

@ -1,10 +1,10 @@
using System.Collections.ObjectModel;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using ReactiveUI;
using static Artemis.VisualScripting.Nodes.Input.PressedKeyPositionNodeEntity;

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Mathematics.Screens;
public class MathExpressionNodeCustomView : ReactiveUserControl<MathExpressionNodeCustomViewModel>
public partial class MathExpressionNodeCustomView : ReactiveUserControl<MathExpressionNodeCustomViewModel>
{
public MathExpressionNodeCustomView()
{

View File

@ -1,10 +1,10 @@
using System.Reactive.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.Core.Events;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using ReactiveUI;
using ReactiveUI.Validation.Extensions;

View File

@ -7,7 +7,6 @@
<ComboBox IsEnabled="{Binding EnumValues.Count}"
Items="{Binding EnumValues}"
SelectedItem="{Binding CurrentValue}"
VirtualizationMode="Simple"
PlaceholderText="Select a value"
Classes="condensed"
VerticalAlignment="Center">

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Operators.Screens;
public class EnumEqualsNodeCustomView : ReactiveUserControl<EnumEqualsNodeCustomViewModel>
public partial class EnumEqualsNodeCustomView : ReactiveUserControl<EnumEqualsNodeCustomViewModel>
{
public EnumEqualsNodeCustomView()
{

View File

@ -1,11 +1,11 @@
using System.Collections.ObjectModel;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.Core.Events;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using Avalonia.Controls.Mixins;
using Avalonia.Threading;
using DynamicData;
using Humanizer;

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Static.Screens;
public class DisplayValueNodeCustomView : ReactiveUserControl<DisplayValueNodeCustomViewModel>
public partial class DisplayValueNodeCustomView : ReactiveUserControl<DisplayValueNodeCustomViewModel>
{
public DisplayValueNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Static.Screens;
public class StaticNumericValueNodeCustomView : ReactiveUserControl<StaticNumericValueNodeCustomViewModel>
public partial class StaticNumericValueNodeCustomView : ReactiveUserControl<StaticNumericValueNodeCustomViewModel>
{
public StaticNumericValueNodeCustomView()
{

View File

@ -4,7 +4,7 @@ using FluentAvalonia.UI.Controls;
namespace Artemis.VisualScripting.Nodes.Static.Screens;
public class StaticSKColorValueNodeCustomView : ReactiveUserControl<StaticSKColorValueNodeCustomViewModel>
public partial class StaticSKColorValueNodeCustomView : ReactiveUserControl<StaticSKColorValueNodeCustomViewModel>
{
public StaticSKColorValueNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Static.Screens;
public class StaticStringValueNodeCustomView : ReactiveUserControl<StaticStringValueNodeCustomViewModel>
public partial class StaticStringValueNodeCustomView : ReactiveUserControl<StaticStringValueNodeCustomViewModel>
{
public StaticStringValueNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
public class EasingFunctionNodeCustomView : ReactiveUserControl<EasingFunctionNodeCustomViewModel>
public partial class EasingFunctionNodeCustomView : ReactiveUserControl<EasingFunctionNodeCustomViewModel>
{
public EasingFunctionNodeCustomView()
{

View File

@ -3,7 +3,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
public class EasingFunctionView : UserControl
public partial class EasingFunctionView : UserControl
{
public EasingFunctionView()
{

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>