Browse Source

Add static overlay icon.

pull/1704/head
Siegfried Pammer 6 years ago
parent
commit
c66423fb9f
  1. 10
      ILSpy/ILSpy.csproj
  2. 4
      ILSpy/Images/Images.cs
  3. BIN
      ILSpy/Images/OverlayStatic.png
  4. 9
      ILSpy/Images/OverlayStatic.xaml
  5. 3
      ILSpy/Images/TypeIcon.cs
  6. 8
      ILSpy/TreeNodes/TypeTreeNode.cs

10
ILSpy/ILSpy.csproj

@ -322,6 +322,8 @@ @@ -322,6 +322,8 @@
<Page Include="Images\Open.xaml" />
<Page Include="Images\OverlayInternal.xaml" />
<Page Include="Images\OverlayPrivate.xaml" />
<Page Include="Images\OverlayProtected.xaml" />
<Page Include="Images\OverlayStatic.xaml" />
<Page Include="Images\Refresh.xaml" />
<Page Include="Images\Search.xaml" />
<Page Include="Images\Sort.xaml" />
@ -450,6 +452,14 @@ @@ -450,6 +452,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Images\OverlayProtected.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Images\OverlayStatic.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Images\Refresh.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

4
ILSpy/Images/Images.cs

@ -215,7 +215,6 @@ namespace ICSharpCode.ILSpy @@ -215,7 +215,6 @@ namespace ICSharpCode.ILSpy
PreloadPublicIconToCache(TypeIcon.Struct, Images.Struct);
PreloadPublicIconToCache(TypeIcon.Interface, Images.Interface);
PreloadPublicIconToCache(TypeIcon.Delegate, Images.Delegate);
PreloadPublicIconToCache(TypeIcon.StaticClass, Images.StaticClass);
}
protected override object GetBaseImage(TypeIcon icon)
@ -237,9 +236,6 @@ namespace ICSharpCode.ILSpy @@ -237,9 +236,6 @@ namespace ICSharpCode.ILSpy
case TypeIcon.Delegate:
baseImage = Images.Delegate;
break;
case TypeIcon.StaticClass:
baseImage = Images.StaticClass;
break;
default:
throw new ArgumentOutOfRangeException(nameof(icon), $"TypeIcon.{icon} is not supported!");
}

BIN
ILSpy/Images/OverlayStatic.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 144 B

9
ILSpy/Images/OverlayStatic.xaml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<DrawingGroup xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M7,16L16,16 16,7 7,7z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M14,9L9,9 9,14 14,14z M15,15L8,15 8,8 15,8z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M12,12L12,10 10,10 10,11 11,11 11,12 10,12 10,13 13,13 13,12z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M12,12L12,10 10,10 10,11 11,11 11,12 10,12 10,13 13,13 13,12z M14,14L9,14 9,9 14,9z" />
</DrawingGroup.Children>
</DrawingGroup>

3
ILSpy/Images/TypeIcon.cs

@ -25,7 +25,6 @@ namespace ICSharpCode.ILSpy @@ -25,7 +25,6 @@ namespace ICSharpCode.ILSpy
Enum,
Struct,
Interface,
Delegate,
StaticClass
Delegate
}
}

8
ILSpy/TreeNodes/TypeTreeNode.cs

@ -112,11 +112,12 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -112,11 +112,12 @@ namespace ICSharpCode.ILSpy.TreeNodes
public static object GetIcon(ITypeDefinition type)
{
return Images.GetIcon(GetTypeIcon(type), GetOverlayIcon(type));
return Images.GetIcon(GetTypeIcon(type, out bool isStatic), GetOverlayIcon(type), isStatic);
}
internal static TypeIcon GetTypeIcon(IType type)
internal static TypeIcon GetTypeIcon(IType type, out bool isStatic)
{
isStatic = false;
switch (type.Kind) {
case TypeKind.Interface:
return TypeIcon.Interface;
@ -127,8 +128,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -127,8 +128,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
case TypeKind.Enum:
return TypeIcon.Enum;
default:
if (type.GetDefinition()?.IsStatic == true)
return TypeIcon.StaticClass;
isStatic = type.GetDefinition()?.IsStatic == true;
return TypeIcon.Class;
}
}

Loading…
Cancel
Save