Highlight how results matched

This commit is contained in:
SysC0mp
2019-12-03 15:25:19 +01:00
parent a004ef65af
commit 601d6f37af
7 changed files with 52 additions and 37 deletions

View File

@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Wox.Infrastructure;
using Wox.Infrastructure.Storage;
namespace Wox.Plugin.Folder
@@ -53,6 +54,7 @@ namespace Wox.Plugin.Folder
Title = item.Nickname,
IcoPath = item.Path,
SubTitle = "Ctrl + Enter to open the directory",
TitleHighlightData = StringMatcher.FuzzySearch(item.Nickname, search).MatchData,
Action = c =>
{
if (c.SpecialKeyState.CtrlPressed)
@@ -148,6 +150,8 @@ namespace Wox.Plugin.Folder
}
});
string searchNickname = new FolderLink { Path = query.Search }.Nickname;
//Add children directories
DirectoryInfo[] dirs = new DirectoryInfo(search).GetDirectories();
foreach (DirectoryInfo dir in dirs)
@@ -162,6 +166,7 @@ namespace Wox.Plugin.Folder
Title = dir.Name,
IcoPath = dir.FullName,
SubTitle = "Ctrl + Enter to open the directory",
TitleHighlightData = StringMatcher.FuzzySearch(dir.Name, searchNickname).MatchData,
Action = c =>
{
if (c.SpecialKeyState.CtrlPressed)
@@ -197,6 +202,7 @@ namespace Wox.Plugin.Folder
{
Title = Path.GetFileName(filePath),
IcoPath = filePath,
TitleHighlightData = StringMatcher.FuzzySearch(file.Name, searchNickname).MatchData,
Action = c =>
{
try