mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1352 from Flow-Launcher/rounded-icon-mask-field
Rounded icon mask field
This commit is contained in:
commit
a200adaa9f
3 changed files with 26 additions and 3 deletions
|
|
@ -66,6 +66,10 @@ namespace Flow.Launcher.Plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Determines if Icon has a border radius
|
||||
/// </summary>
|
||||
public bool RoundedIcon { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Delegate function, see <see cref="Icon"/>
|
||||
|
|
|
|||
|
|
@ -82,13 +82,17 @@
|
|||
BorderThickness="0">
|
||||
<Image
|
||||
x:Name="ImageIcon"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Width="{Binding IconXY}"
|
||||
Height="{Binding IconXY}"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Source="{Binding Image, TargetNullValue={x:Null}}"
|
||||
Stretch="Uniform"
|
||||
Visibility="{Binding ShowIcon}" />
|
||||
Visibility="{Binding ShowIcon}">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
</Border>
|
||||
<Border
|
||||
Margin="9,0,0,0"
|
||||
|
|
|
|||
|
|
@ -84,6 +84,19 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public double IconRadius
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Result.RoundedIcon)
|
||||
{
|
||||
return IconXY / 2;
|
||||
}
|
||||
return IconXY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Visibility ShowGlyph
|
||||
{
|
||||
get
|
||||
|
|
@ -175,6 +188,8 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public string QuerySuggestionText { get; set; }
|
||||
|
||||
public double IconXY { get; set; } = 32;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is ResultViewModel r && Result.Equals(r.Result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue