Skip to content

Commit bd1499b

Browse files
committed
Add clip mask
1 parent 70ea6a8 commit bd1499b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Flow.Launcher/ResultListBox.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@
8888
HorizontalAlignment="Center"
8989
Source="{Binding Image, TargetNullValue={x:Null}}"
9090
Stretch="Uniform"
91-
Visibility="{Binding ShowIcon}" />
91+
Visibility="{Binding ShowIcon}">
92+
<Image.Clip>
93+
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
94+
</Image.Clip>
95+
</Image>
9296
</Border>
9397
<Border
9498
Margin="9,0,0,0"

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ public Visibility ShowIcon
8484
}
8585
}
8686

87+
public double IconRadius
88+
{
89+
get
90+
{
91+
if (Result.RoundedIcon)
92+
{
93+
return IconXY / 2;
94+
}
95+
return IconXY;
96+
}
97+
98+
}
99+
87100
public Visibility ShowGlyph
88101
{
89102
get

0 commit comments

Comments
 (0)