Browse Source

Don't bleed custom node text colour through the selection

Auto-loaded and non-public assembly-tree nodes set an explicit TextBlock foreground, which overrode the selected-row foreground and left the dim/gray colour bleeding through the accent selection fill -- often barely legible. Scope those foreground setters to DataGridRow:not(:selected) so the override drops on selection and the text inherits the normal selected-row foreground, like every other node.
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
a3ffa7a7d6
  1. 9
      ILSpy/AssemblyTree/AssemblyListPane.axaml

9
ILSpy/AssemblyTree/AssemblyListPane.axaml

@ -7,13 +7,18 @@ @@ -7,13 +7,18 @@
x:Class="ILSpy.AssemblyTree.AssemblyListPane"
x:DataType="tree:AssemblyTreeModel">
<UserControl.Styles>
<Style Selector="TextBlock.autoloaded">
<!-- Custom node text colours (auto-loaded, non-public) apply only while the row is NOT
selected: on a selected row the selection's own foreground must win so the text stays
legible against the accent fill instead of the dim colour bleeding through. The
:not(:selected) ancestor guard drops the override on selection, letting the TextBlock
inherit the selected-row foreground like every other node. -->
<Style Selector="DataGridRow:not(:selected) TextBlock.autoloaded">
<Setter Property="Foreground" Value="{DynamicResource ILSpy.TreeAutoloadedForeground}" />
</Style>
<!-- Non-public members (private / internal / etc.) read in gray so the visible API
surface stands out at a glance. The class is applied via Classes.nonPublicAPI
binding on the cell-template TextBlock. -->
<Style Selector="TextBlock.nonPublicAPI">
<Style Selector="DataGridRow:not(:selected) TextBlock.nonPublicAPI">
<Setter Property="Foreground" Value="{DynamicResource ILSpy.TreeNonPublicForeground}" />
</Style>
<!-- Thunderbird-style context-menu target highlight. A right-click marks its target row

Loading…
Cancel
Save