mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
20 lines
656 B
C#
20 lines
656 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Flow.Launcher.Converters;
|
|
|
|
public class IconRadiusConverter : IMultiValueConverter
|
|
{
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (values is not [double size, bool isIconCircular])
|
|
throw new ArgumentException("IconRadiusConverter must have 2 parameters: [double, bool]");
|
|
|
|
return isIconCircular ? size / 2 : size;
|
|
}
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
}
|