mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Handle Font file
This commit is contained in:
parent
2af29f8376
commit
b86a2a8f5f
1 changed files with 24 additions and 12 deletions
|
|
@ -6,6 +6,7 @@ using Flow.Launcher.Infrastructure.Image;
|
|||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using System.IO;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -60,14 +61,25 @@ namespace Flow.Launcher.ViewModel
|
|||
Result = result;
|
||||
|
||||
Image = new LazyAsync<ImageSource>(
|
||||
SetImage,
|
||||
ImageLoader.DefaultImage,
|
||||
() =>
|
||||
{
|
||||
OnPropertyChanged(nameof(Image));
|
||||
});
|
||||
SetImage,
|
||||
ImageLoader.DefaultImage,
|
||||
() =>
|
||||
{
|
||||
OnPropertyChanged(nameof(Image));
|
||||
});
|
||||
|
||||
Glyph = Result.Glyph;
|
||||
if (Result.Glyph.FontFamily.Contains('/'))
|
||||
{
|
||||
var fontPath = Result.Glyph.FontFamily;
|
||||
Glyph = Path.IsPathRooted(fontPath) ? Result.Glyph : Result.Glyph with
|
||||
{
|
||||
FontFamily = Path.Combine(Result.PluginDirectory, fontPath)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Glyph = Result.Glyph;
|
||||
}
|
||||
}
|
||||
|
||||
Settings = settings;
|
||||
|
|
@ -81,12 +93,12 @@ namespace Flow.Launcher.ViewModel
|
|||
public string OpenResultModifiers => Settings.OpenResultModifiers;
|
||||
|
||||
public string ShowTitleToolTip => string.IsNullOrEmpty(Result.TitleToolTip)
|
||||
? Result.Title
|
||||
: Result.TitleToolTip;
|
||||
? Result.Title
|
||||
: Result.TitleToolTip;
|
||||
|
||||
public string ShowSubTitleToolTip => string.IsNullOrEmpty(Result.SubTitleToolTip)
|
||||
? Result.SubTitle
|
||||
: Result.SubTitleToolTip;
|
||||
? Result.SubTitle
|
||||
: Result.SubTitleToolTip;
|
||||
|
||||
public LazyAsync<ImageSource> Image { get; set; }
|
||||
|
||||
|
|
@ -140,4 +152,4 @@ namespace Flow.Launcher.ViewModel
|
|||
return Result.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue