mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Added priority to title results
This commit is contained in:
@@ -64,24 +64,49 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
{
|
{
|
||||||
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0 || item.InfoTip.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0 || item.InfoTip.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||||
{
|
{
|
||||||
results.Add(new Result()
|
|
||||||
|
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0) //Items with Query in title have higher score.
|
||||||
{
|
{
|
||||||
Title = item.LocalizedString,
|
results.Insert(0, new Result()
|
||||||
SubTitle = item.InfoTip,
|
|
||||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + ".ico", //Relative path to plugin directory
|
|
||||||
Action = e =>
|
|
||||||
{
|
{
|
||||||
try
|
Title = item.LocalizedString,
|
||||||
|
SubTitle = item.InfoTip,
|
||||||
|
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + ".ico",
|
||||||
|
Action = e =>
|
||||||
{
|
{
|
||||||
Process.Start(item.ExecutablePath);
|
try
|
||||||
|
{
|
||||||
|
Process.Start(item.ExecutablePath);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//Silently Fail for now..
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
results.Add(new Result()
|
||||||
|
{
|
||||||
|
Title = item.LocalizedString,
|
||||||
|
SubTitle = item.InfoTip,
|
||||||
|
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + ".ico",
|
||||||
|
Action = e =>
|
||||||
{
|
{
|
||||||
//Silently Fail for now..
|
try
|
||||||
|
{
|
||||||
|
Process.Start(item.ExecutablePath);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//Silently Fail for now..
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
Reference in New Issue
Block a user