Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Flow.Launcher.Plugin/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public string IcoPath
}
}
}
/// <summary>
/// Determines if Icon has a border radius
/// </summary>
public bool RoundedIcon { get; set; } = false;

/// <summary>
/// Delegate function, see <see cref="Icon"/>
Expand Down
10 changes: 7 additions & 3 deletions Flow.Launcher/ResultListBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions Flow.Launcher/ViewModel/ResultViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ public Visibility ShowIcon
}
}

public double IconRadius
{
get
{
if (Result.RoundedIcon)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is a bit hacky🤣
And also you may need a OnPropertyChanged? (maybe not because fody handles that)

{
return IconXY / 2;
}
return IconXY;
}

}

public Visibility ShowGlyph
{
get
Expand Down Expand Up @@ -165,6 +178,8 @@ private async ValueTask LoadImageAsync()

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);
Expand Down