Browse Source

Fix dynamic Foreground of non-public nodes.

pull/2334/head
tom-englert 4 years ago
parent
commit
4058628835
  1. 2
      ILSpy/TreeNodes/AssemblyTreeNode.cs
  2. 17
      ILSpy/TreeNodes/ILSpyTreeNode.cs
  3. 4
      SharpTreeView/SharpTreeNode.cs
  4. 13
      SharpTreeView/Themes/Generic.xaml

2
ILSpy/TreeNodes/AssemblyTreeNode.cs

@ -547,7 +547,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (!loadedAssm.HasLoadError) if (!loadedAssm.HasLoadError)
{ {
loadedAssm.IsAutoLoaded = false; loadedAssm.IsAutoLoaded = false;
node.RaisePropertyChanged(nameof(node.Foreground)); node.RaisePropertyChanged(nameof(ILSpyTreeNode.IsAutoLoaded));
} }
} }
MainWindow.Instance.CurrentAssemblyList.RefreshSave(); MainWindow.Instance.CurrentAssemblyList.RefreshSave();

17
ILSpy/TreeNodes/ILSpyTreeNode.cs

@ -185,22 +185,5 @@ namespace ICSharpCode.ILSpy.TreeNodes
public virtual bool IsAutoLoaded { public virtual bool IsAutoLoaded {
get { return false; } get { return false; }
} }
public override System.Windows.Media.Brush Foreground {
get {
if (IsPublicAPI)
if (IsAutoLoaded)
{
// HACK: should not be hard coded?
return System.Windows.Media.Brushes.SteelBlue;
}
else
{
return base.Foreground;
}
else
return System.Windows.SystemColors.GrayTextBrush;
}
}
} }
} }

4
SharpTreeView/SharpTreeNode.cs

@ -122,10 +122,6 @@ namespace ICSharpCode.TreeView
get { return null; } get { return null; }
} }
public virtual Brush Foreground {
get { return SystemColors.WindowTextBrush; }
}
public virtual object Icon { public virtual object Icon {
get { return null; } get { return null; }
} }

13
SharpTreeView/Themes/Generic.xaml

@ -179,13 +179,20 @@
<Border Background="Transparent"> <Border Background="Transparent">
<Border Background="{TemplateBinding Background}"> <Border Background="{TemplateBinding Background}">
<Default:SharpTreeNodeView x:Name="nodeView" <Default:SharpTreeNodeView x:Name="nodeView"
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</Border> </Border>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsSelected" <DataTrigger Binding="{Binding IsAutoLoaded}"
Value="True"> Value="True">
<Setter Property="Foreground" Value="SteelBlue" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPublicAPI}"
Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</DataTrigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="nodeView" <Setter TargetName="nodeView"
Property="TextBackground" Property="TextBackground"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" /> Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />

Loading…
Cancel
Save