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 @@