Skip to content

Commit

Permalink
Add Lucide Icons v0.378.0 (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed May 5, 2024
2 parents f4ba51c + be8bc05 commit e3b40b8
Show file tree
Hide file tree
Showing 24 changed files with 3,497 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -46,6 +46,7 @@ This `IconPacks` library contains controls, markup extensions and converters to
| [Fork Awesome](https://forkaweso.me/) | 1.2.0 | 794 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.ForkAwesome/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.ForkAwesome.svg?style=flat-square&&label=ForkAwesome"></a> |
| [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> |
| [Jam Icons](https://github.com/michaelampr/jam) | 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> |
| [Lucide Icons](https://github.com/lucide-icons/lucide) | 0.378.0 | 1460 | <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> |
| [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> |
| [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> |
| [Material Icons (Google)](https://github.com/google/material-design-icons) | 4.0.0 | 8413 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.MaterialDesign/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.MaterialDesign.svg?style=flat-square&&label=MaterialDesign"></a> |
Expand Down
14 changes: 14 additions & 0 deletions src/MahApps.Metro.IconPacks.sln
Expand Up @@ -80,6 +80,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.Mem
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
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.Lucide", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.Lucide.csproj", "{1E35D230-1B57-4EDC-967E-B8972D4271BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -510,6 +512,18 @@ Global
{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
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|x64.ActiveCfg = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|x64.Build.0 = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|x86.ActiveCfg = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Debug|x86.Build.0 = Debug|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|Any CPU.Build.0 = Release|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|x64.ActiveCfg = Release|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|x64.Build.0 = Release|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|x86.ActiveCfg = Release|Any CPU
{1E35D230-1B57-4EDC-967E-B8972D4271BD}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
76 changes: 76 additions & 0 deletions src/MahApps.Metro.IconPacks/Icons/Lucide/PackIconLucide.cs
@@ -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>
/// Lucide Icons are licensed under [ISC License](<see><cref>https://github.com/lucide-icons/lucide?tab=ISC-1-ov-file#readme</cref></see>).
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/lucide-icons/lucide</cref></see>.
/// </summary>
[MetaData("Lucide Icons", "https://github.com/lucide-icons/lucide", "https://github.com/lucide-icons/lucide?tab=ISC-1-ov-file#readme")]
public class PackIconLucide : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconLucideKind), typeof(PackIconLucide), new PropertyMetadata(default(PackIconLucideKind), KindPropertyChangedCallback));

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

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

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

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

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

protected override void UpdateData()
{
if (Kind != default(PackIconLucideKind))
{
string data = null;
PackIconLucideDataFactory.DataIndex.Value?.TryGetValue(Kind, out data);
this.Data = data;
}
else
{
this.Data = null;
}
}
}
}
@@ -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 LucideCursorExtension : LucideImageExtension, IPackIconCursorExtension
{
public LucideCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush;
public LucideCursorExtension(PackIconLucideKind 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);
}
}
}

0 comments on commit e3b40b8

Please sign in to comment.