Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: Support for coloured vector icons. #1681

Merged
merged 10 commits into from
Jun 25, 2024
5 changes: 0 additions & 5 deletions src/NexusMods.App.UI/Assets/Icons/add_circle_24px.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/bookmarks_24px.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/collections.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/discord.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/disk_20px.svg

This file was deleted.

10 changes: 0 additions & 10 deletions src/NexusMods.App.UI/Assets/Icons/forum.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/list_filled_24px.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/mod_library.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/mods.svg

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/stethoscope_24px.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/NexusMods.App.UI/Assets/Icons/videogame_asset_24px.svg

This file was deleted.

12 changes: 11 additions & 1 deletion src/NexusMods.Icons/IconValue.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Avalonia.Media;
using JetBrains.Annotations;
using NexusMods.Icons.SimpleVector;
using Union = OneOf.OneOf<
NexusMods.Icons.Empty,
NexusMods.Icons.ProjektankerIcon,
NexusMods.Icons.AvaloniaImage,
NexusMods.Icons.AvaloniaSvg,
NexusMods.Icons.AvaloniaPathIcon>;
NexusMods.Icons.AvaloniaPathIcon,
NexusMods.Icons.SimpleVectorIcon>;

namespace NexusMods.Icons;

Expand Down Expand Up @@ -42,6 +44,11 @@ public Geometry? GeometrySetter
{
set => Value = new AvaloniaPathIcon(value);
}

public SimpleVectorIconImage? SimpleVectorSetter
{
set => Value = new SimpleVectorIcon(value);
}

public IconValue()
{
Expand All @@ -57,6 +64,7 @@ public IconValue(Union input)
public static implicit operator IconValue(AvaloniaImage value) => new(value);
public static implicit operator IconValue(AvaloniaSvg value) => new(value);
public static implicit operator IconValue(AvaloniaPathIcon value) => new(value);
public static implicit operator IconValue(SimpleVectorIcon value) => new(value);
}

[PublicAPI]
Expand All @@ -74,3 +82,5 @@ public record struct AvaloniaSvg(string? Path);
[PublicAPI]
public record struct AvaloniaPathIcon(Geometry? Geometry);

[PublicAPI]
public record struct SimpleVectorIcon(SimpleVectorIconImage Image);
Loading
Loading