mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
Removing action on folder result, and displaying folder path on selecting a folder result from the folder plugin.
This commit is contained in:
@@ -94,29 +94,8 @@ namespace Wox.Plugin.Folder
|
|||||||
Title = title,
|
Title = title,
|
||||||
IcoPath = path,
|
IcoPath = path,
|
||||||
SubTitle = subtitle,
|
SubTitle = subtitle,
|
||||||
|
QueryTextDisplay = path,
|
||||||
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
|
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
|
||||||
Action = c =>
|
|
||||||
{
|
|
||||||
if (c.SpecialKeyState.CtrlPressed)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Process.Start(_fileExplorerProgramName, path);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, "Could not start " + path);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string changeTo = path.EndsWith("\\") ? path : path + "\\";
|
|
||||||
changeTo = string.IsNullOrEmpty(query.ActionKeyword) ? changeTo : query.ActionKeyword + " " + changeTo;
|
|
||||||
bool requery = true;
|
|
||||||
_context.API.ChangeQuery(changeTo, requery);
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path }
|
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ namespace Wox.Plugin
|
|||||||
|
|
||||||
public string FontFamily { get; set; }
|
public string FontFamily { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The text that will get displayed in the Search text box, when this item is selected in the result list.
|
||||||
|
/// </summary>
|
||||||
|
public string QueryTextDisplay { get; set; }
|
||||||
|
|
||||||
public string IcoPath
|
public string IcoPath
|
||||||
{
|
{
|
||||||
get { return _icoPath; }
|
get { return _icoPath; }
|
||||||
|
|||||||
@@ -255,7 +255,8 @@ namespace Wox.ViewModel
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Result.Title.ToString();
|
var display = String.IsNullOrEmpty(Result.QueryTextDisplay) ? Result.Title : Result.QueryTextDisplay;
|
||||||
|
return display;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user