Skip to content

Commit

Permalink
feat: add Circum Icons Free v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed May 4, 2024
1 parent e95145c commit 9588449
Show file tree
Hide file tree
Showing 23 changed files with 1,118 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This `IconPacks` library contains controls, markup extensions and converters to
| Complete IconPacks collection with all Icons in one package | | | <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> |
| [Bootstrap Icons](https://icons.getbootstrap.com/) | 1.11.3 | 2050 | <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> |
| [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> |
| [Circum Icons Free](https://github.com/Klarr-Agency/Circum-Icons) | 1.1 | 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> |
| [Codicons](https://github.com/microsoft/vscode-codicons) | 0.0.35 | 438 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Codicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Codicons.svg?style=flat-square&&label=Codicons"></a> |
| [Coolicons](https://github.com/krystonschwarze/coolicons) | 4.1 | 442 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Coolicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Coolicons.svg?style=flat-square&&label=Coolicons"></a> |
| [Entypo+](http://www.entypo.com/) | | 411 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Entypo/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Entypo.svg?style=flat-square&&label=Entypo"></a> |
Expand Down
14 changes: 14 additions & 0 deletions src/MahApps.Metro.IconPacks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.MemoryIcons", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.MemoryIcons.csproj", "{A4425946-87FA-4F7A-A9BF-A97D73608BBE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.CircumIcons", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.CircumIcons.csproj", "{F98A503F-1CC4-4243-91CF-995048C81856}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -496,6 +498,18 @@ Global
{A4425946-87FA-4F7A-A9BF-A97D73608BBE}.Release|x64.Build.0 = Release|Any CPU
{A4425946-87FA-4F7A-A9BF-A97D73608BBE}.Release|x86.ActiveCfg = Release|Any CPU
{A4425946-87FA-4F7A-A9BF-A97D73608BBE}.Release|x86.Build.0 = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|x64.ActiveCfg = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|x64.Build.0 = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|x86.ActiveCfg = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Debug|x86.Build.0 = Debug|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|Any CPU.Build.0 = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|x64.ActiveCfg = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|x64.Build.0 = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|x86.ActiveCfg = Release|Any CPU
{F98A503F-1CC4-4243-91CF-995048C81856}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
#if (NETFX_CORE || WINDOWS_UWP)
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
#else
using System.Windows;
#endif

namespace MahApps.Metro.IconPacks
{
/// <summary>
/// All icons sourced from GitHub Octicons <see><cref>https://github.com/Klarr-Agency/Circum-Icons</cref></see>
/// In accordance of <see><cref>https://github.com/Klarr-Agency/Circum-Icons?tab=MPL-2.0-1-ov-file</cref></see>.
/// </summary>
[MetaData("Circum Icons Free", "https://github.com/Klarr-Agency/Circum-Icons", "https://github.com/Klarr-Agency/Circum-Icons?tab=MPL-2.0-1-ov-file")]
public class PackIconCircumIcons : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconCircumIconsKind), typeof(PackIconCircumIcons), new PropertyMetadata(default(PackIconCircumIconsKind), KindPropertyChangedCallback));

private static void KindPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue != e.OldValue)
{
((PackIconCircumIcons)dependencyObject).UpdateData();
}
}

/// <summary>
/// Gets or sets the icon to display.
/// </summary>
public PackIconCircumIconsKind Kind
{
get { return (PackIconCircumIconsKind)GetValue(KindProperty); }
set { SetValue(KindProperty, value); }
}

#if !(NETFX_CORE || WINDOWS_UWP)
static PackIconCircumIcons()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIconCircumIcons), new FrameworkPropertyMetadata(typeof(PackIconCircumIcons)));
}
#endif

public PackIconCircumIcons()
{
#if NETFX_CORE || WINDOWS_UWP
this.DefaultStyleKey = typeof(PackIconCircumIcons);
#endif
}

protected override void SetKind<TKind>(TKind iconKind)
{
#if NETFX_CORE || WINDOWS_UWP
BindingOperations.SetBinding(this, PackIconCircumIcons.KindProperty, new Binding() { Source = iconKind, Mode = BindingMode.OneTime });
#else
this.SetCurrentValue(KindProperty, iconKind);
#endif
}

protected override void UpdateData()
{
if (Kind != default(PackIconCircumIconsKind))
{
string data = null;
PackIconCircumIconsDataFactory.DataIndex.Value?.TryGetValue(Kind, out data);
this.Data = data;
}
else
{
this.Data = null;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;

namespace MahApps.Metro.IconPacks
{
[MarkupExtensionReturnType(typeof(Cursor))]
public class CircumIconsCursorExtension : CircumIconsImageExtension, IPackIconCursorExtension
{
public CircumIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush;
public CircumIconsCursorExtension(PackIconCircumIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush;

/// <inheritdoc/>
public Point HotSpot { get; set; }
/// <inheritdoc/>
public double Width { get; set; } = PackIconCursorHelper.DefaultWidth;
/// <inheritdoc/>
public double Height { get; set; } = PackIconCursorHelper.DefaultHeight;
/// <inheritdoc/>
public Brush StrokeBrush { get; set; }
/// <inheritdoc/>
public double StrokeThickness { get; set; } = PackIconCursorHelper.DefaultStrokeThickness;

public override object ProvideValue(IServiceProvider serviceProvider)
{
TransformGroup transformGroup = (TransformGroup)GetTransformGroup(this.Kind);
Geometry geometry = PackIconCursorHelper.GetCursorGeometry(GetPathData(this.Kind), transformGroup, Width, Height);
return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot);
}
}
}
Loading

0 comments on commit 9588449

Please sign in to comment.