Skip to content

Commit 1cf1664

Browse files
authored
Add Keyrune Icons v3.17.1 (#376)
Add Keyrune Icons v3.17.1
2 parents ed12dfa + 8da71f6 commit 1cf1664

24 files changed

+964
-37
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The same icons are also available for [Avalonia](https://avaloniaui.net/ with th
3333

3434
| Icon collection | Version | ∑ | NuGet |
3535
|---|--:|--:|:--|
36-
| Complete IconPacks collection with all Icons in one package | | 65208 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.svg?style=flat-square&&label=IconPacks"></a> |
36+
| Complete IconPacks collection with all Icons in one package | | 65612 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.svg?style=flat-square&&label=IconPacks"></a> |
3737
| [Bootstrap Icons](https://icons.getbootstrap.com/) | 1.13.1 | 2078 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.BootstrapIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.BootstrapIcons.svg?style=flat-square&&label=BootstrapIcons"></a> |
3838
| [Boxicons](https://boxicons.com/) | 2.1.4 | 1634 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.BoxIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.BoxIcons.svg?style=flat-square&&label=BoxIcons"></a> |
3939
| [Circum Icons Free](https://github.com/Klarr-Agency/Circum-Icons) | 2.0.2 | 288 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.CircumIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.CircumIcons.svg?style=flat-square&&label=CircumIcons"></a> |
@@ -52,6 +52,7 @@ The same icons are also available for [Avalonia](https://avaloniaui.net/ with th
5252
| [Game Icons](https://github.com/game-icons/icons) | May 4, 2025 | 4170 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.GameIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.GameIcons.svg?style=flat-square&&label=GameIcons"></a> |
5353
| [Ionicons](https://ionicons.com/) | 4.6.4.1 | 696 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Ionicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Ionicons.svg?style=flat-square&&label=Ionicons"></a> |
5454
| [Jam Icons](https://jam-icons.com/) | 3.1.0 | 940 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.JamIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.JamIcons.svg?style=flat-square&&label=JamIcons"></a> |
55+
| [Keyrune Icons](https://github.com/andrewgioia/keyrune) | 3.17.1 | 404 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.KeyruneIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.KeyruneIcons.svg?style=flat-square&&label=KeyruneIcons"></a> |
5556
| [Lucide Icons](https://github.com/lucide-icons/lucide) | 0.539.0 | 1630 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Lucide/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Lucide.svg?style=flat-square&&label=Lucide"></a> |
5657
| [Material Design Icons](https://pictogrammers.com/library/mdi/) | 7.4.47 | 7447 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Material/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Material.svg?style=flat-square&&label=Material"></a> |
5758
| [Material Design Icons Light](https://github.com/Templarian/MaterialDesignLight) | 0.2.63 | 257 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.MaterialLight/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.MaterialLight.svg?style=flat-square&&label=MaterialLight"></a> |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
4+
<PropertyGroup>
5+
<DefineConstants>$(DefineConstants);KEYRUNEICONS</DefineConstants>
6+
<IconsName>KeyruneIcons</IconsName>
7+
<AssemblyName>MahApps.Metro.IconPacks.KeyruneIcons</AssemblyName>
8+
<Title>MahApps.Metro.IconPacks.KeyruneIcons</Title>
9+
<RootNamespace>MahApps.Metro.IconPacks</RootNamespace>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\MahApps.Metro.IconPacks.Core\MahApps.Metro.IconPacks.Core.csproj" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Compile Remove="Resources\*.*" />
18+
<EmbeddedResource Include="Resources\*.*" />
19+
</ItemGroup>
20+
21+
<!-- WPF Items include -->
22+
<ItemGroup Condition="'$(IsWpf)' == 'true'">
23+
<None Remove="**\*.rd.xml" />
24+
<Compile Remove="Path*.*" />
25+
<Page Generator="MSBuild:Compile" Include="Themes\WPF\*.xaml" Link="Themes\%(RecursiveDir)%(Filename)%(Extension)" SubType="Designer" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" />
26+
</ItemGroup>
27+
28+
<!-- UWP Items include -->
29+
<ItemGroup Condition="'$(IsUwp)' == 'true'">
30+
<Compile Remove="*Image*.cs;*Cursor*.cs" />
31+
<Compile Remove="Themes\**\*.*" />
32+
<EmbeddedResource Include="Properties\$(AssemblyName).rd.xml" />
33+
<Page Generator="MSBuild:Compile" Include="Themes\UAP\*.xaml" Link="Themes\%(RecursiveDir)%(Filename)%(Extension)" SubType="Designer" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" />
34+
<Compile DependentUpon="%(Filename)" Update="**\*.xaml.cs" />
35+
</ItemGroup>
36+
37+
</Project>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System;
2+
using System.Collections.Generic;
3+
#if (NETFX_CORE || WINDOWS_UWP)
4+
using Windows.UI.Xaml;
5+
using Windows.UI.Xaml.Data;
6+
#else
7+
using System.Windows;
8+
#endif
9+
10+
namespace MahApps.Metro.IconPacks
11+
{
12+
/// <summary>
13+
/// All icons sourced from GitHub <see><cref>https://github.com/andrewgioia/keyrune</cref></see>
14+
/// In accordance of <see><cref>https://github.com/andrewgioia/keyrune?tab=License-1-ov-file</cref></see>.
15+
/// </summary>
16+
[MetaData("Keyrune Icons", "https://github.com/andrewgioia/keyrune", "https://github.com/andrewgioia/keyrune?tab=License-1-ov-file")]
17+
public class PackIconKeyruneIcons : PackIconControlBase
18+
{
19+
public static readonly DependencyProperty KindProperty
20+
= DependencyProperty.Register(nameof(Kind), typeof(PackIconKeyruneIconsKind), typeof(PackIconKeyruneIcons), new PropertyMetadata(default(PackIconKeyruneIconsKind), KindPropertyChangedCallback));
21+
22+
private static void KindPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
23+
{
24+
if (e.NewValue != e.OldValue)
25+
{
26+
((PackIconKeyruneIcons)dependencyObject).UpdateData();
27+
}
28+
}
29+
30+
/// <summary>
31+
/// Gets or sets the icon to display.
32+
/// </summary>
33+
public PackIconKeyruneIconsKind Kind
34+
{
35+
get { return (PackIconKeyruneIconsKind)GetValue(KindProperty); }
36+
set { SetValue(KindProperty, value); }
37+
}
38+
39+
#if !(NETFX_CORE || WINDOWS_UWP)
40+
static PackIconKeyruneIcons()
41+
{
42+
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIconKeyruneIcons), new FrameworkPropertyMetadata(typeof(PackIconKeyruneIcons)));
43+
}
44+
#endif
45+
46+
public PackIconKeyruneIcons()
47+
{
48+
#if NETFX_CORE || WINDOWS_UWP
49+
this.DefaultStyleKey = typeof(PackIconKeyruneIcons);
50+
#endif
51+
}
52+
53+
protected override void SetKind<TKind>(TKind iconKind)
54+
{
55+
#if NETFX_CORE || WINDOWS_UWP
56+
BindingOperations.SetBinding(this, PackIconKeyruneIcons.KindProperty, new Binding() { Source = iconKind, Mode = BindingMode.OneTime });
57+
#else
58+
this.SetCurrentValue(KindProperty, iconKind);
59+
#endif
60+
}
61+
62+
protected override void UpdateData()
63+
{
64+
if (Kind != default(PackIconKeyruneIconsKind))
65+
{
66+
string data = null;
67+
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(Kind, out data);
68+
this.Data = data;
69+
}
70+
else
71+
{
72+
this.Data = null;
73+
}
74+
}
75+
}
76+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Windows;
3+
using System.Windows.Input;
4+
using System.Windows.Markup;
5+
using System.Windows.Media;
6+
7+
namespace MahApps.Metro.IconPacks
8+
{
9+
[MarkupExtensionReturnType(typeof(Cursor))]
10+
public class KeyruneIconsCursorExtension : KeyruneIconsImageExtension, IPackIconCursorExtension
11+
{
12+
public KeyruneIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush;
13+
public KeyruneIconsCursorExtension(PackIconKeyruneIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush;
14+
15+
/// <inheritdoc/>
16+
public Point HotSpot { get; set; }
17+
/// <inheritdoc/>
18+
public double Width { get; set; } = PackIconCursorHelper.DefaultWidth;
19+
/// <inheritdoc/>
20+
public double Height { get; set; } = PackIconCursorHelper.DefaultHeight;
21+
/// <inheritdoc/>
22+
public Brush StrokeBrush { get; set; }
23+
/// <inheritdoc/>
24+
public double StrokeThickness { get; set; } = PackIconCursorHelper.DefaultStrokeThickness;
25+
26+
public override object ProvideValue(IServiceProvider serviceProvider)
27+
{
28+
TransformGroup transformGroup = (TransformGroup)GetTransformGroup(this.Kind);
29+
Geometry geometry = PackIconCursorHelper.GetCursorGeometry(GetPathData(this.Kind), transformGroup, Width, Height);
30+
return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot);
31+
}
32+
}
33+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#if (NETFX_CORE || WINDOWS_UWP)
2+
using Windows.UI.Xaml.Markup;
3+
#else
4+
using System;
5+
using System.Windows.Markup;
6+
#endif
7+
8+
namespace MahApps.Metro.IconPacks
9+
{
10+
#if (NETFX_CORE || WINDOWS_UWP)
11+
[MarkupExtensionReturnType(ReturnType = typeof(PackIconKeyruneIcons))]
12+
#else
13+
[MarkupExtensionReturnType(typeof(PackIconKeyruneIcons))]
14+
#endif
15+
public class KeyruneIconsExtension : BasePackIconExtension
16+
{
17+
public KeyruneIconsExtension()
18+
{
19+
}
20+
21+
#if !(NETFX_CORE || WINDOWS_UWP)
22+
public KeyruneIconsExtension(PackIconKeyruneIconsKind kind)
23+
{
24+
this.Kind = kind;
25+
}
26+
27+
[ConstructorArgument("kind")]
28+
#endif
29+
public PackIconKeyruneIconsKind Kind { get; set; }
30+
31+
#if (NETFX_CORE || WINDOWS_UWP)
32+
protected override object ProvideValue()
33+
#else
34+
public override object ProvideValue(IServiceProvider serviceProvider)
35+
#endif
36+
{
37+
return this.GetPackIcon<PackIconKeyruneIcons, PackIconKeyruneIconsKind>(this.Kind);
38+
}
39+
}
40+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Windows.Markup;
3+
using System.Windows.Media;
4+
5+
namespace MahApps.Metro.IconPacks
6+
{
7+
[MarkupExtensionReturnType(typeof(ImageSource))]
8+
public class KeyruneIconsImageExtension : BasePackIconImageExtension
9+
{
10+
public KeyruneIconsImageExtension()
11+
{
12+
}
13+
14+
public KeyruneIconsImageExtension(PackIconKeyruneIconsKind kind)
15+
{
16+
this.Kind = kind;
17+
}
18+
19+
[ConstructorArgument("kind")]
20+
public PackIconKeyruneIconsKind Kind { get; set; }
21+
22+
public override object ProvideValue(IServiceProvider serviceProvider)
23+
{
24+
return CreateImageSource(this.Kind, this.Brush ?? Brushes.Black);
25+
}
26+
27+
/// <inheritdoc />
28+
protected override string GetPathData(object iconKind)
29+
{
30+
string data = null;
31+
if (iconKind is PackIconKeyruneIconsKind kind)
32+
{
33+
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(kind, out data);
34+
}
35+
return data;
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)