From 75fc6c02d27ad9f68fca54452925824e50572c1c Mon Sep 17 00:00:00 2001 From: ericek111 Date: Sat, 24 Oct 2026 03:55:20 +0000 Subject: [PATCH] Stop the recorder from hiding text with a null foreground Setting Foreground to null is a local value of no brush, so the Record button, connected devices in the list and the status line had no text colour. Clear the value instead. The bitrate step is now 4 kbps. Co-Authored-By: Claude Sonnet 5.5 --- src/Nonemm.Recorder.App/ChannelRow.cs | 18 ++++++++++++++++-- src/Nonemm.Recorder.App/MainWindow.axaml | 2 +- src/Nonemm.Recorder.App/MainWindow.axaml.cs | 18 ++++++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/Nonemm.Recorder.App/ChannelRow.cs b/src/Nonemm.Recorder.App/ChannelRow.cs index 274de07..9d6de90 100644 --- a/src/Nonemm.Recorder.App/ChannelRow.cs +++ b/src/Nonemm.Recorder.App/ChannelRow.cs @@ -34,7 +34,14 @@ internal sealed class ChannelRow : Grid Margin = new Thickness(0, 2); sources.ItemTemplate = new FuncDataTemplate((choice, _) => - new TextBlock { Text = choice?.Label, Foreground = choice?.Brush }); + { + TextBlock text = new() { Text = choice?.Label }; + if (choice?.Brush is { } brush) + { + text.Foreground = brush; + } + return text; + }); sources.SelectionChanged += (_, _) => OnSourcePicked(); monitor.Content = new PathIcon { Data = Geometry.Parse(HeadphonesPath), Width = 16, Height = 16 }; @@ -90,7 +97,14 @@ internal sealed class ChannelRow : Grid double peak = Math.Sqrt(Math.Min(1.0, Channel.TakePeak())); shown = Math.Max(peak, shown * 0.85); level.Value = shown; - sources.Foreground = Channel.IsAvailable ? null : new SolidColorBrush(Color.Parse("#D93025")); + if (Channel.IsAvailable) + { + sources.ClearValue(TemplatedControl.ForegroundProperty); + } + else + { + sources.Foreground = new SolidColorBrush(Color.Parse("#D93025")); + } ToolTip.SetTip(sources, Channel.IsAvailable ? null : Channel.Problem); } diff --git a/src/Nonemm.Recorder.App/MainWindow.axaml b/src/Nonemm.Recorder.App/MainWindow.axaml index d633eba..8ccec82 100644 --- a/src/Nonemm.Recorder.App/MainWindow.axaml +++ b/src/Nonemm.Recorder.App/MainWindow.axaml @@ -13,7 +13,7 @@