mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add file path in preview
This commit is contained in:
parent
0c4f50a89f
commit
1cedb6e619
2 changed files with 19 additions and 10 deletions
|
|
@ -77,6 +77,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
AutoCompleteText = GetAutoCompleteText(title, query, path, ResultType.Folder),
|
||||
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
|
||||
CopyText = path,
|
||||
Preview = new Result.PreviewInfo
|
||||
{
|
||||
FilePath = path,
|
||||
},
|
||||
Action = c =>
|
||||
{
|
||||
// open folder
|
||||
|
|
@ -162,6 +166,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
Score = 500,
|
||||
ProgressBar = progressValue,
|
||||
ProgressBarColor = progressBarColor,
|
||||
Preview = new Result.PreviewInfo
|
||||
{
|
||||
FilePath = path,
|
||||
},
|
||||
Action = _ =>
|
||||
{
|
||||
OpenFolder(path);
|
||||
|
|
@ -234,15 +242,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
internal static Result CreateFileResult(string filePath, Query query, int score = 0, bool windowsIndexed = false)
|
||||
{
|
||||
Result.PreviewInfo preview = IsMedia(Path.GetExtension(filePath))
|
||||
? new Result.PreviewInfo
|
||||
{
|
||||
IsMedia = true,
|
||||
PreviewImagePath = filePath,
|
||||
FilePath = filePath,
|
||||
}
|
||||
: Result.PreviewInfo.Default;
|
||||
|
||||
bool isMedia = IsMedia(Path.GetExtension(filePath));
|
||||
var title = Path.GetFileName(filePath);
|
||||
|
||||
var result = new Result
|
||||
|
|
@ -250,7 +250,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
Title = title,
|
||||
SubTitle = Path.GetDirectoryName(filePath),
|
||||
IcoPath = filePath,
|
||||
Preview = preview,
|
||||
Preview = new Result.PreviewInfo
|
||||
{
|
||||
IsMedia = isMedia,
|
||||
PreviewImagePath = isMedia ? filePath : null,
|
||||
FilePath = filePath,
|
||||
},
|
||||
AutoCompleteText = GetAutoCompleteText(title, query, filePath, ResultType.File),
|
||||
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
|
||||
Score = score,
|
||||
|
|
|
|||
|
|
@ -168,6 +168,10 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
Score = matchResult.Score,
|
||||
TitleHighlightData = matchResult.MatchData,
|
||||
ContextData = this,
|
||||
Preview = new Result.PreviewInfo
|
||||
{
|
||||
FilePath = ExecutablePath,
|
||||
},
|
||||
Action = c =>
|
||||
{
|
||||
// Ctrl + Enter to open containing folder
|
||||
|
|
|
|||
Loading…
Reference in a new issue