From 7dbf321f426f92f81ef6cd74a30b88f6b2f1d04f Mon Sep 17 00:00:00 2001 From: Maximilien Noal Date: Sun, 17 Nov 2024 17:15:28 +0100 Subject: [PATCH] feat: IsCsIp signaled by FontWeight, not column Signed-off-by: Maximilien Noal --- .../Converters/BoolToFontWeightConverter.cs | 22 +++++++++++++++++++ src/Spice86/Views/DisassemblyView.axaml | 11 ++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/Spice86/Converters/BoolToFontWeightConverter.cs diff --git a/src/Spice86/Converters/BoolToFontWeightConverter.cs b/src/Spice86/Converters/BoolToFontWeightConverter.cs new file mode 100644 index 000000000..cd5c8cc02 --- /dev/null +++ b/src/Spice86/Converters/BoolToFontWeightConverter.cs @@ -0,0 +1,22 @@ +namespace Spice86.Converters; + +using Avalonia.Data; +using Avalonia.Data.Converters; +using Avalonia.Media; + +using System; +using System.Globalization; +using System.Reflection; + +internal class BoolToFontWeightConverter : IValueConverter { + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { + if(value is bool source) { + return source ? FontWeight.Bold : FontWeight.Normal; + } + return BindingOperations.DoNothing; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { + return BindingOperations.DoNothing; + } +} diff --git a/src/Spice86/Views/DisassemblyView.axaml b/src/Spice86/Views/DisassemblyView.axaml index a9e9b5fbf..06a060c28 100644 --- a/src/Spice86/Views/DisassemblyView.axaml +++ b/src/Spice86/Views/DisassemblyView.axaml @@ -12,6 +12,7 @@ + - - + + + + + + +