1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Upgraded to preview8

This commit is contained in:
Robert 2023-05-11 23:10:40 +02:00
parent 3c6d770ec2
commit bf6674e44f
24 changed files with 117 additions and 113 deletions

View File

@ -35,7 +35,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.4" /> <PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="EmbedIO" Version="3.5.2" /> <PackageReference Include="EmbedIO" Version="3.5.2" />
<PackageReference Include="HidSharp" Version="2.1.0" /> <PackageReference Include="HidSharp" Version="2.1.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" /> <PackageReference Include="Humanizer.Core" Version="2.14.1" />

View File

@ -16,11 +16,11 @@
<None Remove=".gitignore" /> <None Remove=".gitignore" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="ReactiveUI" Version="18.4.26" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -15,11 +15,11 @@
<None Remove=".gitignore" /> <None Remove=".gitignore" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="ReactiveUI" Version="18.4.26" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -10,13 +10,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DynamicData" Version="7.13.1" /> <PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview7.1" /> <PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview8" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.0.0-preview3" /> <PackageReference Include="Material.Icons.Avalonia" Version="2.0.0-preview3" />
<PackageReference Include="ReactiveUI" Version="18.4.26" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />

View File

@ -64,7 +64,7 @@ public partial class ArtemisIcon : UserControl
Background = TextElement.GetForeground(this), Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(iconString)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality} OpacityMask = new ImageBrush(new Bitmap(iconString))
}; };
} }
else else

View File

@ -67,8 +67,7 @@ public class DeviceVisualizer : Control
drawingContext.DrawImage( drawingContext.DrawImage(
_deviceImage, _deviceImage,
new Rect(_deviceImage.Size), new Rect(_deviceImage.Size),
new Rect(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height), new Rect(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height)
RenderOptions.GetBitmapInterpolationMode(this)
); );
if (!ShowColors) if (!ShowColors)
@ -306,8 +305,8 @@ public class DeviceVisualizer : Control
using DrawingContext context = renderTargetBitmap.CreateDrawingContext(); using DrawingContext context = renderTargetBitmap.CreateDrawingContext();
using Bitmap bitmap = new(device.Layout.Image.LocalPath); using Bitmap bitmap = new(device.Layout.Image.LocalPath);
context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size), BitmapInterpolationMode.HighQuality);
context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size));
lock (_deviceVisualizerLeds) lock (_deviceVisualizerLeds)
{ {
foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds) foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds)

View File

@ -49,8 +49,7 @@ internal class DeviceVisualizerLed
drawingContext.DrawImage( drawingContext.DrawImage(
bitmap, bitmap,
new Rect(bitmap.Size), new Rect(bitmap.Size),
new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale), new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale)
BitmapInterpolationMode.HighQuality
); );
} }
catch catch

View File

@ -75,7 +75,7 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable
Background = TextElement.GetForeground(this), Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(stream)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality} OpacityMask = new ImageBrush(new Bitmap(stream))
}; };
} }

View File

@ -21,12 +21,12 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Win32" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.Win32" Version="11.0.0-preview8" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" /> <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Microsoft.Win32" Version="2.0.1" /> <PackageReference Include="Microsoft.Win32" Version="2.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" /> <PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />

View File

@ -16,12 +16,6 @@ public class AutoRunProvider : IAutoRunProvider
{ {
private readonly string _autorunName = $"Artemis 2 autorun {Environment.UserName}"; private readonly string _autorunName = $"Artemis 2 autorun {Environment.UserName}";
private readonly string _oldAutorunName = "Artemis 2 autorun"; private readonly string _oldAutorunName = "Artemis 2 autorun";
private readonly IAssetLoader _assetLoader;
public AutoRunProvider(IAssetLoader assetLoader)
{
_assetLoader = assetLoader;
}
private async Task<bool> IsAutoRunTaskCreated(string autorunName) private async Task<bool> IsAutoRunTaskCreated(string autorunName)
{ {
@ -43,7 +37,7 @@ public class AutoRunProvider : IAutoRunProvider
private async Task CreateAutoRunTask(TimeSpan autoRunDelay, string autorunName) private async Task CreateAutoRunTask(TimeSpan autoRunDelay, string autorunName)
{ {
await using Stream taskFile = _assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/autorun.xml")); await using Stream taskFile = AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/autorun.xml"));
XDocument document = await XDocument.LoadAsync(taskFile, LoadOptions.None, CancellationToken.None); XDocument document = await XDocument.LoadAsync(taskFile, LoadOptions.None, CancellationToken.None);
XElement task = document.Descendants().First(); XElement task = document.Descendants().First();

View File

@ -9,11 +9,11 @@ namespace Artemis.UI.Windows.Providers;
public class CursorProvider : ICursorProvider public class CursorProvider : ICursorProvider
{ {
public CursorProvider(IAssetLoader assetLoader) public CursorProvider()
{ {
Rotate = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_rotate.png"))), new PixelPoint(21, 10)); Rotate = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_rotate.png"))), new PixelPoint(21, 10));
Drag = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag.png"))), new PixelPoint(11, 3)); Drag = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag.png"))), new PixelPoint(11, 3));
DragHorizontal = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag_horizontal.png"))), new PixelPoint(16, 5)); DragHorizontal = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag_horizontal.png"))), new PixelPoint(16, 5));
} }
public Cursor Rotate { get; } public Cursor Rotate { get; }

View File

@ -15,17 +15,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0-preview6" /> <PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview7" /> <PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview8.1" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DryIoc.dll" Version="5.3.4" /> <PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="DynamicData" Version="7.13.1" /> <PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview7.1" /> <PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview8" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Live.Avalonia" Version="1.3.1" /> <PackageReference Include="Live.Avalonia" Version="1.3.1" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.0-b1" /> <PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.0-b1" />

View File

@ -7,7 +7,6 @@ using Artemis.UI.Services.Updating;
using Artemis.UI.Shared; using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.NodeEditor; using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.ProfileEditor; using Artemis.UI.Shared.Services.ProfileEditor;
using Avalonia.Platform;
using DryIoc; using DryIoc;
namespace Artemis.UI.DryIoc; namespace Artemis.UI.DryIoc;
@ -24,11 +23,8 @@ public static class ContainerExtensions
public static void RegisterUI(this IContainer container) public static void RegisterUI(this IContainer container)
{ {
Assembly[] thisAssembly = {typeof(ContainerExtensions).Assembly}; Assembly[] thisAssembly = {typeof(ContainerExtensions).Assembly};
container.RegisterInstance(new AssetLoader(), IfAlreadyRegistered.Throw);
container.Register<IAssetLoader, AssetLoader>(Reuse.Singleton);
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<ViewModelBase>()); container.RegisterMany(thisAssembly, type => type.IsAssignableTo<ViewModelBase>(), setup: Setup.With(preventDisposal: true));
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IToolViewModel>() && type.IsInterface); container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IToolViewModel>() && type.IsInterface);
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IVmFactory>() && type != typeof(PropertyVmFactory)); container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IVmFactory>() && type != typeof(PropertyVmFactory));

View File

@ -6,7 +6,6 @@ using Artemis.UI.Screens.Root;
using Artemis.UI.Shared; using Artemis.UI.Shared;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI; using Avalonia.ReactiveUI;
using ReactiveUI; using ReactiveUI;
@ -15,28 +14,24 @@ namespace Artemis.UI;
public partial class MainWindow : ReactiveAppWindow<RootViewModel> public partial class MainWindow : ReactiveAppWindow<RootViewModel>
{ {
private bool _activated; private bool _activated;
private IDisposable? _positionObserver;
public MainWindow() public MainWindow()
{ {
Opened += OnOpened; Opened += OnOpened;
Closed += OnClosed;
Activated += OnActivated; Activated += OnActivated;
Deactivated += OnDeactivated; Deactivated += OnDeactivated;
InitializeComponent(); InitializeComponent();
ApplyWindowSize(); ApplyWindowSize();
Shared.UI.Clipboard = GetTopLevel(this)!.Clipboard!; Shared.UI.Clipboard = GetTopLevel(this)!.Clipboard!;
RootPanel.LayoutUpdated += OnLayoutUpdated; RootPanel.LayoutUpdated += OnLayoutUpdated;
#if DEBUG #if DEBUG
this.AttachDevTools(); this.AttachDevTools();
#endif #endif
Observable.FromEventPattern<PixelPointEventArgs>(x => PositionChanged += x, x => PositionChanged -= x)
.Select(_ => Unit.Default)
.Merge(this.WhenAnyValue(vm => vm.WindowState, vm => vm.Width, vm => vm.Width, vm => vm.Height).Select(_ => Unit.Default))
.Throttle(TimeSpan.FromMilliseconds(200), AvaloniaScheduler.Instance)
.Subscribe(_ => SaveWindowSize());
} }
private void ApplyWindowSize() private void ApplyWindowSize()
@ -53,7 +48,7 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
RootViewModel.WindowSizeSetting.Value ??= new WindowSize(); RootViewModel.WindowSizeSetting.Value ??= new WindowSize();
RootViewModel.WindowSizeSetting.Value.ApplyFromWindow(this); RootViewModel.WindowSizeSetting.Value.ApplyFromWindow(this);
} }
private void OnLayoutUpdated(object? sender, EventArgs e) private void OnLayoutUpdated(object? sender, EventArgs e)
{ {
SidebarContentControl.Width = RootPanel.Bounds.Width >= 1800 ? 300 : 240; SidebarContentControl.Width = RootPanel.Bounds.Width >= 1800 ? 300 : 240;
@ -61,8 +56,18 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
private void OnOpened(object? sender, EventArgs e) private void OnOpened(object? sender, EventArgs e)
{ {
Opened -= OnOpened;
TitleBar.ExtendsContentIntoTitleBar = true; TitleBar.ExtendsContentIntoTitleBar = true;
_positionObserver = Observable.FromEventPattern<PixelPointEventArgs>(x => PositionChanged += x, x => PositionChanged -= x)
.Select(_ => Unit.Default)
.Merge(this.WhenAnyValue(vm => vm.WindowState, vm => vm.Width, vm => vm.Width, vm => vm.Height).Select(_ => Unit.Default))
.Throttle(TimeSpan.FromMilliseconds(200), AvaloniaScheduler.Instance)
.Subscribe(_ => SaveWindowSize());
}
private void OnClosed(object? sender, EventArgs e)
{
_positionObserver?.Dispose();
} }
private void OnActivated(object? sender, EventArgs e) private void OnActivated(object? sender, EventArgs e)
@ -74,5 +79,4 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
{ {
ViewModel?.Unfocused(); ViewModel?.Unfocused();
} }
} }

View File

@ -59,7 +59,7 @@ public class PlaybackViewModel : ActivatableViewModelBase
updateTimer.Start(); updateTimer.Start();
Disposable.Create(() => Disposable.Create(() =>
{ {
// updateTimer.Stop(); updateTimer.Stop();
_settingsService.GetSetting("ProfileEditor.RepeatTimeline", true).Value = _repeating && _repeatTimeline; _settingsService.GetSetting("ProfileEditor.RepeatTimeline", true).Value = _repeating && _repeatTimeline;
_settingsService.GetSetting("ProfileEditor.RepeatSegment", false).Value = _repeating && _repeatSegment; _settingsService.GetSetting("ProfileEditor.RepeatSegment", false).Value = _repeating && _repeatSegment;
}).DisposeWith(d); }).DisposeWith(d);

View File

@ -179,12 +179,12 @@ public class PropertyGroupViewModel : PropertyViewModelBase, IDisposable
public void Dispose() public void Dispose()
{ {
LayerPropertyGroup.VisibilityChanged -= LayerPropertyGroupOnVisibilityChanged; LayerPropertyGroup.VisibilityChanged -= LayerPropertyGroupOnVisibilityChanged;
foreach (ViewModelBase viewModelBase in Children) while (Children.Any())
{ {
if (viewModelBase is IDisposable disposable) if (Children[0] is IDisposable disposable)
disposable.Dispose(); disposable.Dispose();
Children.RemoveAt(0);
} }
_keyframeSubscription.Dispose(); _keyframeSubscription.Dispose();
} }
} }

View File

@ -22,7 +22,6 @@ namespace Artemis.UI.Screens.Root;
public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvider public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvider
{ {
private readonly IAssetLoader _assetLoader;
private readonly ICoreService _coreService; private readonly ICoreService _coreService;
private readonly IDebugService _debugService; private readonly IDebugService _debugService;
private readonly DefaultTitleBarViewModel _defaultTitleBarViewModel; private readonly DefaultTitleBarViewModel _defaultTitleBarViewModel;
@ -41,7 +40,6 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
IMainWindowService mainWindowService, IMainWindowService mainWindowService,
IDebugService debugService, IDebugService debugService,
IUpdateService updateService, IUpdateService updateService,
IAssetLoader assetLoader,
DefaultTitleBarViewModel defaultTitleBarViewModel, DefaultTitleBarViewModel defaultTitleBarViewModel,
ISidebarVmFactory sidebarVmFactory) ISidebarVmFactory sidebarVmFactory)
{ {
@ -53,7 +51,6 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
_windowService = windowService; _windowService = windowService;
_debugService = debugService; _debugService = debugService;
_updateService = updateService; _updateService = updateService;
_assetLoader = assetLoader;
_defaultTitleBarViewModel = defaultTitleBarViewModel; _defaultTitleBarViewModel = defaultTitleBarViewModel;
_sidebarVmFactory = sidebarVmFactory; _sidebarVmFactory = sidebarVmFactory;
_lifeTime = (IClassicDesktopStyleApplicationLifetime) Application.Current!.ApplicationLifetime!; _lifeTime = (IClassicDesktopStyleApplicationLifetime) Application.Current!.ApplicationLifetime!;

View File

@ -11,7 +11,7 @@
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="15" MaxWidth="800"> <StackPanel Margin="15" MaxWidth="800">
<Grid RowDefinitions="*,*" ColumnDefinitions="Auto,*,Auto"> <Grid RowDefinitions="*,*" ColumnDefinitions="Auto,*,Auto">
<Image Grid.Column="0" Grid.RowSpan="2" Width="65" Height="65" VerticalAlignment="Center" Source="/Assets/Images/Logo/bow.png" Margin="0 0 20 0"/> <Image Grid.Column="0" Grid.RowSpan="2" Width="65" Height="65" VerticalAlignment="Center" Source="/Assets/Images/Logo/bow.png" Margin="0 0 20 0" />
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="36" VerticalAlignment="Bottom"> <TextBlock Grid.Row="0" Grid.Column="1" FontSize="36" VerticalAlignment="Bottom">
Artemis 2 Artemis 2
</TextBlock> </TextBlock>
@ -52,9 +52,10 @@
Height="75" Height="75"
Width="75" Width="75"
Margin="0 0 15 0" Margin="0 0 15 0"
IsVisible="{CompiledBinding RobertProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> IsVisible="{CompiledBinding RobertProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill> <Ellipse.Fill>
<ImageBrush Source="{CompiledBinding RobertProfileImage}" BitmapInterpolationMode="HighQuality" /> <ImageBrush Source="{CompiledBinding RobertProfileImage}" />
</Ellipse.Fill> </Ellipse.Fill>
</Ellipse> </Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0"> <TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -80,9 +81,10 @@
Height="75" Height="75"
Width="75" Width="75"
Margin="0 0 15 0" Margin="0 0 15 0"
IsVisible="{CompiledBinding DarthAffeProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> IsVisible="{CompiledBinding DarthAffeProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill> <Ellipse.Fill>
<ImageBrush Source="{CompiledBinding DarthAffeProfileImage}" BitmapInterpolationMode="HighQuality" /> <ImageBrush Source="{CompiledBinding DarthAffeProfileImage}" />
</Ellipse.Fill> </Ellipse.Fill>
</Ellipse> </Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0"> <TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -108,9 +110,10 @@
Height="75" Height="75"
Width="75" Width="75"
Margin="0 0 15 0" Margin="0 0 15 0"
IsVisible="{CompiledBinding DrMeteorProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> IsVisible="{CompiledBinding DrMeteorProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill> <Ellipse.Fill>
<ImageBrush Source="{CompiledBinding DrMeteorProfileImage}" BitmapInterpolationMode="HighQuality" /> <ImageBrush Source="{CompiledBinding DrMeteorProfileImage}" />
</Ellipse.Fill> </Ellipse.Fill>
</Ellipse> </Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0"> <TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -136,9 +139,10 @@
Height="75" Height="75"
Width="75" Width="75"
Margin="0 0 15 0" Margin="0 0 15 0"
IsVisible="{CompiledBinding KaiProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> IsVisible="{CompiledBinding KaiProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill> <Ellipse.Fill>
<ImageBrush Source="{CompiledBinding KaiProfileImage}" BitmapInterpolationMode="HighQuality" /> <ImageBrush Source="{CompiledBinding KaiProfileImage}" />
</Ellipse.Fill> </Ellipse.Fill>
</Ellipse> </Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0"> <TextBlock Grid.Row="0" Grid.Column="1" Padding="0">

View File

@ -79,9 +79,13 @@
<Border IsVisible="{CompiledBinding ProfileConfiguration.Icon.Fill}" Background="{DynamicResource CheckerboardBrush}" CornerRadius="{DynamicResource CardCornerRadius}" <Border IsVisible="{CompiledBinding ProfileConfiguration.Icon.Fill}" Background="{DynamicResource CheckerboardBrush}" CornerRadius="{DynamicResource CardCornerRadius}"
Width="78" Height="78"> Width="78" Height="78">
<Border Name="FillPreview" Background="{DynamicResource TextFillColorPrimary}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10"> <Border Name="FillPreview"
Background="{DynamicResource TextFillColorPrimary}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" Margin="10"
RenderOptions.BitmapInterpolationMode="HighQuality" >
<Border.OpacityMask> <Border.OpacityMask>
<ImageBrush Source="{CompiledBinding SelectedBitmapSource}" BitmapInterpolationMode="HighQuality" /> <ImageBrush Source="{CompiledBinding SelectedBitmapSource}" />
</Border.OpacityMask> </Border.OpacityMask>
</Border> </Border>
</Border> </Border>
@ -127,8 +131,9 @@
</ComboBox> </ComboBox>
</StackPanel> </StackPanel>
<CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">Fade when enabling and disabling</CheckBox> <CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">
Fade when enabling and disabling
</CheckBox>
</StackPanel> </StackPanel>
</Border> </Border>

View File

@ -18,11 +18,13 @@ public class NodeMenuItemViewModel
public NodeMenuItemViewModel(ReactiveCommand<NodeData, Unit> createNode, NodeData nodeData) public NodeMenuItemViewModel(ReactiveCommand<NodeData, Unit> createNode, NodeData nodeData)
{ {
Header = nodeData.Name; Header = nodeData.Name;
Subtitle = nodeData.Description;
Items = new List<NodeMenuItemViewModel>(); Items = new List<NodeMenuItemViewModel>();
CreateNode = ReactiveCommand.Create(() => { createNode.Execute(nodeData).Subscribe(); }); CreateNode = ReactiveCommand.Create(() => { createNode.Execute(nodeData).Subscribe(); });
} }
public string Header { get; } public string Header { get; }
public string? Subtitle { get; }
public List<NodeMenuItemViewModel> Items { get; } public List<NodeMenuItemViewModel> Items { get; }
public ReactiveCommand<Unit, Unit>? CreateNode { get; } public ReactiveCommand<Unit, Unit>? CreateNode { get; }
} }

View File

@ -1,20 +1,20 @@
<windowing:AppWindow xmlns="https://github.com/avaloniaui" <windowing:AppWindow xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:visualScripting="clr-namespace:Artemis.UI.Screens.VisualScripting" xmlns:visualScripting="clr-namespace:Artemis.UI.Screens.VisualScripting"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core" xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
xmlns:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia" xmlns:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
xmlns:system="clr-namespace:System;assembly=System.Runtime" xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.VisualScripting.NodeScriptWindowView" x:Class="Artemis.UI.Screens.VisualScripting.NodeScriptWindowView"
x:DataType="visualScripting:NodeScriptWindowViewModel" x:DataType="visualScripting:NodeScriptWindowViewModel"
Icon="/Assets/Images/Logo/application.ico" Icon="/Assets/Images/Logo/application.ico"
Title="Artemis | Visual Script Editor" Title="Artemis | Visual Script Editor"
Width="1200" Width="1200"
Height="800"> Height="800">
<Window.KeyBindings> <Window.KeyBindings>
<KeyBinding Command="{CompiledBinding History.Undo}" Gesture="Ctrl+Z" /> <KeyBinding Command="{CompiledBinding History.Undo}" Gesture="Ctrl+Z" />
<KeyBinding Command="{CompiledBinding History.Redo}" Gesture="Ctrl+Y" /> <KeyBinding Command="{CompiledBinding History.Redo}" Gesture="Ctrl+Y" />
@ -30,10 +30,21 @@
<MenuItem.Styles> <MenuItem.Styles>
<Style Selector="MenuItem > MenuItem > MenuItem" x:DataType="visualScripting:NodeMenuItemViewModel"> <Style Selector="MenuItem > MenuItem > MenuItem" x:DataType="visualScripting:NodeMenuItemViewModel">
<Setter Property="Command" Value="{CompiledBinding CreateNode}" /> <Setter Property="Command" Value="{CompiledBinding CreateNode}" />
<Setter Property="Header" Value="{CompiledBinding Header}" />
<Setter Property="ItemsSource" Value="{CompiledBinding Items}" /> <Setter Property="ItemsSource" Value="{CompiledBinding Items}" />
</Style> </Style>
</MenuItem.Styles> </MenuItem.Styles>
<MenuItem.DataTemplates>
<DataTemplate DataType="{x:Type visualScripting:NodeMenuItemViewModel}">
<StackPanel Background="Transparent" MaxWidth="300">
<TextBlock Text="{CompiledBinding Header}" TextWrapping="Wrap"></TextBlock>
<TextBlock IsVisible="{CompiledBinding Subtitle, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Foreground="{DynamicResource TextFillColorSecondary}"
Text="{CompiledBinding Subtitle}"
TextWrapping="Wrap">
</TextBlock>
</StackPanel>
</DataTemplate>
</MenuItem.DataTemplates>
</MenuItem> </MenuItem>
<MenuItem Header="Auto-arrange" Command="{CompiledBinding AutoArrange}" InputGesture="Ctrl+F"> <MenuItem Header="Auto-arrange" Command="{CompiledBinding AutoArrange}" InputGesture="Ctrl+F">
<MenuItem.Icon> <MenuItem.Icon>

View File

@ -8,10 +8,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DryIoc.dll" Version="5.3.4" /> <PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="NoStringEvaluating" Version="2.5.2" /> <PackageReference Include="NoStringEvaluating" Version="2.5.2" />
<PackageReference Include="ReactiveUI" Version="18.4.26" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />

View File

@ -7,8 +7,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.4" /> <PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.1" /> <PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.0.5" /> <PackageReference Include="StrawberryShake.Server" Version="13.0.5" />

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Avalonia" value="https://nuget.avaloniaui.net/repository/avalonia-all/index.json" />
</packageSources>
</configuration>