Skip to content

Commit

Permalink
Merge pull request #1681 from Nexus-Mods/icon-colouring
Browse files Browse the repository at this point in the history
Added: Support for coloured vector icons.
  • Loading branch information
Sewer56 authored Jun 25, 2024
2 parents ef1296e + a94e016 commit ad01530
Show file tree
Hide file tree
Showing 17 changed files with 294 additions and 71 deletions.
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

0 comments on commit ad01530

Please sign in to comment.