Added simple highlight function to the message view

This commit is contained in:
2dust
2025-09-26 15:29:46 +08:00
parent 326bf334e7
commit a652fd879b
3 changed files with 143 additions and 0 deletions
@@ -1,5 +1,6 @@
using System.Reactive.Disposables;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.ReactiveUI;
using Avalonia.Threading;
using ReactiveUI;
@@ -21,6 +22,11 @@ public partial class MsgView : ReactiveUserControl<MsgViewModel>
this.Bind(ViewModel, vm => vm.MsgFilter, v => v.cmbMsgFilter.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.AutoRefresh, v => v.togAutoRefresh.IsChecked).DisposeWith(disposables);
});
TextEditorKeywordHighlighter.Attach(txtMsg, Global.LogLevelColors.ToDictionary(
kv => kv.Key,
kv => (IBrush)new SolidColorBrush(Color.Parse(kv.Value))
));
}
private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)