From 472619035524d67e37bdd8483c63838e894dc22b Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 24 Jun 2023 15:33:59 +0200 Subject: [PATCH 1/8] ColorGradient - Fixed GetColor returning the first stop if position was after the last stop --- src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs index 8550a9b10..a4ea63a11 100644 --- a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs +++ b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs @@ -241,7 +241,7 @@ public class ColorGradient : IList, IList, INotifyCollectionC return _stops[^1].Color; //find the first stop after the position - int stop2Index = 0; + int stop2Index = -1; for (int i = 0; i < _stops.Count; i++) { From d18ef4f5f4f2f330b6d1e0e509281f5a3ab9fa81 Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 4 Jul 2023 20:24:38 +0200 Subject: [PATCH 2/8] Update Avalonia to 11 rc2.2 --- src/Artemis.UI.Linux/Artemis.UI.Linux.csproj | 8 ++++---- src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj | 8 ++++---- src/Artemis.UI.Shared/Artemis.UI.Shared.csproj | 6 +++--- .../Controls/DataModelPicker/DataModelPickerButton.cs | 2 +- src/Artemis.UI.Shared/Controls/NoInputTextBox.cs | 6 ++++-- src/Artemis.UI.Windows/Artemis.UI.Windows.csproj | 10 +++++----- src/Artemis.UI.Windows/Program.cs | 5 ----- src/Artemis.UI/Artemis.UI.csproj | 8 ++++---- src/Artemis.UI/Screens/Root/RootView.axaml.cs | 2 +- .../Artemis.VisualScripting.csproj | 4 ++-- 10 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj index 21c5abd88..a38c1b34c 100644 --- a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj +++ b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj @@ -16,11 +16,11 @@ - - + + - - + + diff --git a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj index 9e2fc0938..72a221df4 100644 --- a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj +++ b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj @@ -15,11 +15,11 @@ - - + + - - + + diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index 3b69f3087..824cd9624 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -10,10 +10,10 @@ - + - - + + diff --git a/src/Artemis.UI.Shared/Controls/DataModelPicker/DataModelPickerButton.cs b/src/Artemis.UI.Shared/Controls/DataModelPicker/DataModelPickerButton.cs index eb8ab30a4..742e64458 100644 --- a/src/Artemis.UI.Shared/Controls/DataModelPicker/DataModelPickerButton.cs +++ b/src/Artemis.UI.Shared/Controls/DataModelPicker/DataModelPickerButton.cs @@ -225,7 +225,7 @@ public class DataModelPickerButton : TemplatedControl private void PathValidationChanged(object? sender, EventArgs e) { - Dispatcher.UIThread.InvokeAsync(UpdateValueDisplay, DispatcherPriority.DataBind); + Dispatcher.UIThread.InvokeAsync(UpdateValueDisplay, DispatcherPriority.Background); } private void UpdateValueDisplay() diff --git a/src/Artemis.UI.Shared/Controls/NoInputTextBox.cs b/src/Artemis.UI.Shared/Controls/NoInputTextBox.cs index de2964464..67ed37900 100644 --- a/src/Artemis.UI.Shared/Controls/NoInputTextBox.cs +++ b/src/Artemis.UI.Shared/Controls/NoInputTextBox.cs @@ -1,11 +1,12 @@ using System; +using Avalonia; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Styling; namespace Artemis.UI.Shared; -internal class NoInputTextBox : TextBox, IStyleable +internal class NoInputTextBox : TextBox { /// protected override void OnKeyDown(KeyEventArgs e) @@ -19,5 +20,6 @@ internal class NoInputTextBox : TextBox, IStyleable // Don't call the base method on purpose } - Type IStyleable.StyleKey => typeof(TextBox); + /// + protected override Type StyleKeyOverride => typeof(TextBox); } \ No newline at end of file diff --git a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj index 0110ec37e..1b839e4bf 100644 --- a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj +++ b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj @@ -21,12 +21,12 @@ - - + + - - - + + + diff --git a/src/Artemis.UI.Windows/Program.cs b/src/Artemis.UI.Windows/Program.cs index 37a113fc2..f9fc5e1f6 100644 --- a/src/Artemis.UI.Windows/Program.cs +++ b/src/Artemis.UI.Windows/Program.cs @@ -36,11 +36,6 @@ internal class Program return AppBuilder.Configure() .UsePlatformDetect() .LogToTrace() - .With(new Win32PlatformOptions - { - UseWindowsUIComposition = true, - CompositionBackdropCornerRadius = 8f - }) .UseReactiveUI(); } diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index 205fae2f5..e6294906e 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -15,12 +15,12 @@ - + - + - - + + diff --git a/src/Artemis.UI/Screens/Root/RootView.axaml.cs b/src/Artemis.UI/Screens/Root/RootView.axaml.cs index 23d822d48..98b9fbc14 100644 --- a/src/Artemis.UI/Screens/Root/RootView.axaml.cs +++ b/src/Artemis.UI/Screens/Root/RootView.axaml.cs @@ -18,7 +18,7 @@ public partial class RootView : ReactiveUserControl { try { - Dispatcher.UIThread.Invoke(() => RootFrame.NavigateFromObject(viewModel)); + // Dispatcher.UIThread.Invoke(() => RootFrame.NavigateFromObject(viewModel)); } catch (Exception) { diff --git a/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj b/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj index c0e7a1bec..9a7e1bdbb 100644 --- a/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj +++ b/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj @@ -8,8 +8,8 @@ - - + + From af1920141c86380e7e66806b121b60dd8fa5a7e4 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 9 Jul 2023 08:29:54 +0200 Subject: [PATCH 3/8] Device visualizer - Clear device cache on UI thread on property change Surface editor - Don't quietly fail device updates --- src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs | 9 ++++++--- .../Screens/SurfaceEditor/SurfaceEditorViewModel.cs | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs index 2b16bb769..6908fadd3 100644 --- a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs +++ b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs @@ -197,9 +197,12 @@ public class DeviceVisualizer : Control private void DevicePropertyChanged(object? sender, PropertyChangedEventArgs e) { - if (Device != null) - BitmapCache.Remove(Device); - Dispatcher.UIThread.Invoke(SetupForDevice, DispatcherPriority.Background); + Dispatcher.UIThread.Invoke(async () => + { + if (Device != null) + BitmapCache.Remove(Device); + await SetupForDevice(); + }, DispatcherPriority.Background); } private void DeviceUpdated(object? sender, EventArgs e) diff --git a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs index e68d8e13a..a6e28ea39 100644 --- a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs +++ b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorViewModel.cs @@ -136,6 +136,10 @@ public class SurfaceEditorViewModel : ActivatableViewModelBase, IMainScreenViewM _saving = true; _rgbService.SaveDevices(); } + catch (Exception e) + { + _windowService.ShowExceptionDialog("Failed to update device positions", e); + } finally { _saving = false; From b298900ed233177a43b90b14a8c046a61892fe8b Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 14 Jul 2023 10:31:40 +0200 Subject: [PATCH 4/8] Upgrade Avalonia and FluentAvalonia, use a props file to sync versions --- src/Artemis.Core/Artemis.Core.csproj | 10 ++++--- src/Artemis.Storage/Artemis.Storage.csproj | 2 ++ src/Artemis.UI.Linux/Artemis.UI.Linux.csproj | 10 ++++--- src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj | 10 ++++--- .../Artemis.UI.Shared.csproj | 16 +++++++----- .../Artemis.UI.Windows.csproj | 14 +++++----- src/Artemis.UI/Artemis.UI.csproj | 26 +++++++++---------- .../VisualEditor/VisualEditorView.axaml.cs | 5 ---- src/Artemis.UI/Screens/Root/RootView.axaml.cs | 2 +- .../SurfaceEditor/SurfaceEditorView.axaml.cs | 5 ---- .../Artemis.VisualScripting.csproj | 9 ++++--- .../Artemis.WebClient.Updating.csproj | 1 + src/Artemis.props | 8 ++++++ src/Artemis.sln | 7 +++++ 14 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 src/Artemis.props diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index 33d2a5382..772adf7d2 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -1,4 +1,6 @@  + + net7.0 false @@ -43,14 +45,14 @@ - - - + + + - + diff --git a/src/Artemis.Storage/Artemis.Storage.csproj b/src/Artemis.Storage/Artemis.Storage.csproj index 6ccd74e0d..fcb97b0c5 100644 --- a/src/Artemis.Storage/Artemis.Storage.csproj +++ b/src/Artemis.Storage/Artemis.Storage.csproj @@ -1,4 +1,6 @@  + + net7.0 false diff --git a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj index a38c1b34c..cb282136f 100644 --- a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj +++ b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj @@ -1,4 +1,6 @@ + + WinExe net7.0 @@ -16,11 +18,11 @@ - - + + - - + + diff --git a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj index 72a221df4..57649624f 100644 --- a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj +++ b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj @@ -1,4 +1,6 @@  + + WinExe net7.0 @@ -15,11 +17,11 @@ - - + + - - + + diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index 824cd9624..15b723fd5 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -1,4 +1,6 @@  + + Library net7.0 @@ -10,18 +12,18 @@ - + - - - + + + - + - - + + diff --git a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj index 1b839e4bf..bd7210217 100644 --- a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj +++ b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj @@ -1,4 +1,6 @@ + + WinExe net7.0-windows10.0.17763.0 @@ -21,18 +23,18 @@ - - + + - - - + + + - + diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index e6294906e..02127d187 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -1,4 +1,6 @@ + + Library net7.0 @@ -15,28 +17,26 @@ - - - + + + - - - + + + - + - - + - - - + + + - diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs index 87e7b3b2e..3fb88d5c5 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/VisualEditor/VisualEditorView.axaml.cs @@ -63,12 +63,7 @@ public partial class VisualEditorView : ReactiveUserControl { try { - // Dispatcher.UIThread.Invoke(() => RootFrame.NavigateFromObject(viewModel)); + Dispatcher.UIThread.Invoke(() => RootFrame.NavigateFromObject(viewModel)); } catch (Exception) { diff --git a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.axaml.cs b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.axaml.cs index 73b747355..797cad4d5 100644 --- a/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.axaml.cs +++ b/src/Artemis.UI/Screens/SurfaceEditor/SurfaceEditorView.axaml.cs @@ -48,11 +48,6 @@ public partial class SurfaceEditorView : ReactiveUserControl + net7.0 @@ -8,14 +9,14 @@ - - - + + + - + diff --git a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj index c31da3c25..056aa9531 100644 --- a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj +++ b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj @@ -1,4 +1,5 @@ + net7.0 diff --git a/src/Artemis.props b/src/Artemis.props new file mode 100644 index 000000000..121967a89 --- /dev/null +++ b/src/Artemis.props @@ -0,0 +1,8 @@ + + + 11.0.0 + 2.0.0 + 2.0.0-prerelease.83 + 2.88.3 + + \ No newline at end of file diff --git a/src/Artemis.sln b/src/Artemis.sln index 2e53b5d9a..1e74be560 100644 --- a/src/Artemis.sln +++ b/src/Artemis.sln @@ -21,6 +21,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.VisualScripting", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.WebClient.Updating", "Artemis.WebClient.Updating\Artemis.WebClient.Updating.csproj", "{7C8C6F50-0CC8-45B3-B608-A7218C005E4B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{44482312-142F-44A4-992C-0AF0F26BAE54}" + ProjectSection(SolutionItems) = preProject + Artemis.props = Artemis.props + Artemis.sln.DotSettings = Artemis.sln.DotSettings + Artemis.sln.DotSettings.user = Artemis.sln.DotSettings.user + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 From a991917ea931e376b481b127a9b84b03328263b2 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 14 Jul 2023 17:02:41 +0100 Subject: [PATCH 5/8] Fixed text selection in the debug logs view --- .../Debugger/Tabs/Logs/LogsDebugView.axaml | 9 +++-- .../Debugger/Tabs/Logs/LogsDebugView.axaml.cs | 33 ------------------- .../Debugger/Tabs/Logs/LogsDebugViewModel.cs | 10 +++++- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml index 5a5c6d457..f41b9b272 100644 --- a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml +++ b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml @@ -2,13 +2,16 @@ 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:aedit="https://github.com/avaloniaui/avaloniaedit" - xmlns:controls="clr-namespace:Artemis.UI.Controls" xmlns:logs="clr-namespace:Artemis.UI.Screens.Debugger.Logs" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.Screens.Debugger.Logs.LogsDebugView" x:DataType="logs:LogsDebugViewModel"> - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml.cs b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml.cs index 219215877..26d8ab003 100644 --- a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml.cs +++ b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugView.axaml.cs @@ -10,50 +10,17 @@ namespace Artemis.UI.Screens.Debugger.Logs; public partial class LogsDebugView : ReactiveUserControl { - private int _lineCount; - public LogsDebugView() { - _lineCount = 0; InitializeComponent(); } - protected override void OnInitialized() { base.OnInitialized(); Dispatcher.UIThread.Post(() => LogsScrollViewer.ScrollToEnd(), DispatcherPriority.ApplicationIdle); } - // private void OnTextChanged(object? sender, EventArgs e) - // { - // if (LogTextEditor.ExtentHeight == 0) - // return; - // - // int linesAdded = LogTextEditor.LineCount - _lineCount; - // double lineHeight = LogTextEditor.ExtentHeight / LogTextEditor.LineCount; - // double outOfScreenTextHeight = LogTextEditor.ExtentHeight - LogTextEditor.VerticalOffset - LogTextEditor.ViewportHeight; - // double outOfScreenLines = outOfScreenTextHeight / lineHeight; - // - // //we need this help distance because of rounding. - // //if we scroll slightly above the end, we still want it - // //to scroll down to the new lines. - // const double GRACE_DISTANCE = 1d; - // - // //if we were at the bottom of the log and - // //if the last log event was 5 lines long - // //we will be 5 lines out sync. - // //if this is the case, scroll down. - // - // //if we are more than that out of sync, - // //the user scrolled up and we should not - // //mess with anything. - // if (_lineCount == 0 || linesAdded + GRACE_DISTANCE > outOfScreenLines) - // { - // Dispatcher.UIThread.Post(() => LogTextEditor.ScrollToEnd(), DispatcherPriority.ApplicationIdle); - // _lineCount = LogTextEditor.LineCount; - // } - // } private void Control_OnSizeChanged(object? sender, SizeChangedEventArgs e) { if (!(LogsScrollViewer.Extent.Height - LogsScrollViewer.Offset.Y - LogsScrollViewer.Bounds.Bottom <= 60)) diff --git a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs index 4df1be54e..47309a3ad 100644 --- a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs @@ -7,7 +7,9 @@ using ReactiveUI; using Serilog.Events; using Serilog.Formatting.Display; using System.IO; +using System.Linq; using System.Reactive.Disposables; +using System.Text; using Avalonia.Controls.Documents; using Avalonia.Media; @@ -54,8 +56,14 @@ public class LogsDebugViewModel : ActivatableViewModelBase _formatter.Format(logEvent, writer); string line = writer.ToString(); + StringBuilder builder = new(); - Lines.Add(new Run(line.TrimEnd('\r', '\n') + '\n') + //hack: https://github.com/AvaloniaUI/Avalonia/issues/10913 + string paddedLine2 = line.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries) + .Aggregate(builder, (sb, s) => sb.Append(s).Append(' ', 400 - s.Length).AppendLine()) + .ToString(); + + Lines.Add(new Run(paddedLine2) { Foreground = logEvent.Level switch { From de7c09f047692f0c767d37b2f8a849526a248529 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 14 Jul 2023 23:19:28 +0100 Subject: [PATCH 6/8] Core - Override ColorSwatch.ToString This cleans up the datamodel viewer a lot, currently since ColorSwatch is a struct, it has a very long name. Since the properties can be seen by looking at the children in the datamodel, this information is useless. --- .../ColorScience/Quantization/ColorSwatch.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Artemis.Core/ColorScience/Quantization/ColorSwatch.cs b/src/Artemis.Core/ColorScience/Quantization/ColorSwatch.cs index 16dd769b3..602f3d480 100644 --- a/src/Artemis.Core/ColorScience/Quantization/ColorSwatch.cs +++ b/src/Artemis.Core/ColorScience/Quantization/ColorSwatch.cs @@ -1,4 +1,5 @@ -using SkiaSharp; +using System.Text; +using SkiaSharp; namespace Artemis.Core.ColorScience; @@ -36,4 +37,14 @@ public readonly record struct ColorSwatch /// The component. /// public SKColor DarkMuted { get; init; } + + /// + /// Override the record ToString method, + /// so we get a cleaner datamodel viewer + /// + /// + public override string? ToString() + { + return base.ToString(); + } } \ No newline at end of file From 27d69bc1bcefbf4e6a5fe4e6cc26637dfe47e23a Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sun, 16 Jul 2023 17:30:27 +0100 Subject: [PATCH 7/8] Fixed enum swich node not respecting DisplayAttribute --- src/Artemis.VisualScripting/Nodes/Branching/EnumSwitchNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Artemis.VisualScripting/Nodes/Branching/EnumSwitchNode.cs b/src/Artemis.VisualScripting/Nodes/Branching/EnumSwitchNode.cs index 5ca915053..eb3803290 100644 --- a/src/Artemis.VisualScripting/Nodes/Branching/EnumSwitchNode.cs +++ b/src/Artemis.VisualScripting/Nodes/Branching/EnumSwitchNode.cs @@ -71,7 +71,7 @@ public class EnumSwitchNode : Node foreach (Enum enumValue in Enum.GetValues(enumType).Cast()) { - InputPin pin = CreateOrAddInputPin(typeof(object), enumValue.ToString().Humanize(LetterCasing.Sentence)); + InputPin pin = CreateOrAddInputPin(typeof(object), enumValue.Humanize(LetterCasing.Sentence)); pin.PinConnected += OnInputPinConnected; pin.PinDisconnected += OnInputPinDisconnected; _inputPins[enumValue] = pin; From 49362132496bd709c37df7ca0fd601d73ad34c95 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 21 Jul 2023 17:00:35 +0100 Subject: [PATCH 8/8] Fix plugin module being case sensitive comparing guids --- src/Artemis.Core/Services/WebServer/PluginsModule.cs | 5 +++-- .../Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Artemis.Core/Services/WebServer/PluginsModule.cs b/src/Artemis.Core/Services/WebServer/PluginsModule.cs index e4d234326..c9d423760 100644 --- a/src/Artemis.Core/Services/WebServer/PluginsModule.cs +++ b/src/Artemis.Core/Services/WebServer/PluginsModule.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using EmbedIO; @@ -15,7 +16,7 @@ public class PluginsModule : WebModuleBase internal PluginsModule(string baseRoute) : base(baseRoute) { - _pluginEndPoints = new Dictionary>(); + _pluginEndPoints = new Dictionary>(comparer: StringComparer.InvariantCultureIgnoreCase); } internal void AddPluginEndPoint(PluginEndPoint registration) diff --git a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs index 47309a3ad..95a87a167 100644 --- a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs @@ -56,14 +56,7 @@ public class LogsDebugViewModel : ActivatableViewModelBase _formatter.Format(logEvent, writer); string line = writer.ToString(); - StringBuilder builder = new(); - - //hack: https://github.com/AvaloniaUI/Avalonia/issues/10913 - string paddedLine2 = line.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries) - .Aggregate(builder, (sb, s) => sb.Append(s).Append(' ', 400 - s.Length).AppendLine()) - .ToString(); - - Lines.Add(new Run(paddedLine2) + Lines.Add(new Run(line.TrimEnd('\r', '\n') + '\n') { Foreground = logEvent.Level switch {