Skip to content

Commit 6845101

Browse files
authored
Merge pull request #35 from MahApps/fix/feathericons
Use fill path for Feather Icons
2 parents 346bc50 + ca9342c commit 6845101

File tree

7 files changed

+7
-75
lines changed

7 files changed

+7
-75
lines changed

src/IconPacks.Avalonia.Core/PackIconControlBase.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<Grid x:Name="PART_InnerGrid">
1414
<Viewbox x:Name="PART_ViewBox">
1515
<Path x:Name="PART_IconPath"
16-
Fill="{TemplateBinding Foreground}"
1716
Data="{TemplateBinding Data}"
1817
Stretch="Uniform"
1918
UseLayoutRounding="False" />
@@ -46,6 +45,7 @@
4645
<Setter Property="StrokeJoin" Value="Round" />
4746
<Setter Property="Width" Value="24" />
4847
<Setter Property="Height" Value="24" />
48+
<Setter Property="Margin" Value="1" />
4949
</Style>
5050

5151
<!-- flipped icon data -->

src/IconPacks.Avalonia.FeatherIcons/PackIconFeatherIcons.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class PackIconFeatherIcons : PackIconControlBase
1414
{
1515
public PackIconFeatherIcons()
1616
{
17-
UpdateIconPseudoClasses(false, true, false);
17+
UpdateIconPseudoClasses(true, false, false);
1818
}
1919

2020
public static readonly StyledProperty<PackIconFeatherIconsKind> KindProperty

src/IconPacks.Avalonia.FeatherIcons/Resources/Icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/IconPacks.Avalonia.Typicons/Resources/Icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/IconPacks.Avalonia/Converter/PackIconKindToImageConverter.cs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Avalonia.Media;
1+
using Avalonia.Media;
22
using IconPacks.Avalonia.Core;
33
using IconPacks.Avalonia.Core.Converter;
44
using IconPacks.Avalonia.BootstrapIcons;
@@ -212,39 +212,5 @@ protected override ScaleTransform GetScaleTransform(object iconKind)
212212
return new ScaleTransform(1, 1);
213213
}
214214
}
215-
216-
/// <inheritdoc />
217-
protected override DrawingGroup GetDrawingGroup(object iconKind, IBrush foregroundBrush, string path)
218-
{
219-
var geometryDrawing = new GeometryDrawing
220-
{
221-
Geometry = StreamGeometry.Parse(path)
222-
};
223-
224-
switch (iconKind)
225-
{
226-
case PackIconFeatherIconsKind:
227-
{
228-
var pen = new Pen(foregroundBrush, 2d)
229-
{
230-
LineCap = PenLineCap.Round,
231-
LineJoin = PenLineJoin.Round,
232-
};
233-
geometryDrawing.Pen = pen;
234-
break;
235-
}
236-
default:
237-
geometryDrawing.Brush = foregroundBrush;
238-
break;
239-
}
240-
241-
var drawingGroup = new DrawingGroup
242-
{
243-
Children = { geometryDrawing },
244-
Transform = this.GetTransformGroup(iconKind)
245-
};
246-
247-
return drawingGroup;
248-
}
249215
}
250216
}

src/IconPacks.Avalonia/PackIconControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected override void UpdateData()
117117
break;
118118

119119
case PackIconFeatherIconsKind:
120-
UpdateIconPseudoClasses(false, true, false);
120+
UpdateIconPseudoClasses(true, false, false);
121121
break;
122122

123123
case PackIconFileIconsKind:

src/IconPacks.Avalonia/PackIconImageExtension.cs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Avalonia.Markup.Xaml;
33
using Avalonia.Media;
44
using IconPacks.Avalonia.Core;
@@ -229,39 +229,5 @@ protected override ScaleTransform GetScaleTransform(object iconKind)
229229
return new ScaleTransform(1, 1);
230230
}
231231
}
232-
233-
/// <inheritdoc />
234-
protected override DrawingGroup GetDrawingGroup(object iconKind, IBrush foregroundBrush, string path)
235-
{
236-
var geometryDrawing = new GeometryDrawing
237-
{
238-
Geometry = StreamGeometry.Parse(path)
239-
};
240-
241-
switch (iconKind)
242-
{
243-
case PackIconFeatherIconsKind:
244-
{
245-
var pen = new Pen(foregroundBrush, 2d)
246-
{
247-
LineCap = PenLineCap.Round,
248-
LineJoin = PenLineJoin.Round,
249-
};
250-
geometryDrawing.Pen = pen;
251-
break;
252-
}
253-
default:
254-
geometryDrawing.Brush = foregroundBrush;
255-
break;
256-
}
257-
258-
var drawingGroup = new DrawingGroup
259-
{
260-
Children = { geometryDrawing },
261-
Transform = this.GetScaleTransform(iconKind)
262-
};
263-
264-
return drawingGroup;
265-
}
266232
}
267233
}

0 commit comments

Comments
 (0)