mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #2529 from Flow-Launcher/improve-context-menu-results-2
Improve context menu results
This commit is contained in:
commit
4721b9758b
2 changed files with 27 additions and 15 deletions
|
|
@ -183,6 +183,31 @@ namespace Flow.Launcher.Plugin
|
|||
return Title + SubTitle + Score;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones the current result
|
||||
/// </summary>
|
||||
public Result Clone()
|
||||
{
|
||||
return new Result
|
||||
{
|
||||
Title = Title,
|
||||
SubTitle = SubTitle,
|
||||
ActionKeywordAssigned = ActionKeywordAssigned,
|
||||
CopyText = CopyText,
|
||||
AutoCompleteText = AutoCompleteText,
|
||||
IcoPath = IcoPath,
|
||||
RoundedIcon = RoundedIcon,
|
||||
Icon = Icon,
|
||||
Glyph = Glyph,
|
||||
Action = Action,
|
||||
AsyncAction = AsyncAction,
|
||||
Score = Score,
|
||||
TitleHighlightData = TitleHighlightData,
|
||||
OriginQuery = OriginQuery,
|
||||
PluginDirectory = PluginDirectory
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Additional data associated with this result
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -688,20 +688,7 @@ namespace Flow.Launcher.ViewModel
|
|||
List<Result> results;
|
||||
if (selected == lastContextMenuResult)
|
||||
{
|
||||
// Use copy to keep the original results unchanged
|
||||
results = lastContextMenuResults.ConvertAll(result => new Result
|
||||
{
|
||||
Title = result.Title,
|
||||
SubTitle = result.SubTitle,
|
||||
IcoPath = result.IcoPath,
|
||||
PluginDirectory = result.PluginDirectory,
|
||||
Action = result.Action,
|
||||
ContextData = result.ContextData,
|
||||
Glyph = result.Glyph,
|
||||
OriginQuery = result.OriginQuery,
|
||||
Score = result.Score,
|
||||
AsyncAction = result.AsyncAction,
|
||||
});
|
||||
results = lastContextMenuResults;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -715,7 +702,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
if (!string.IsNullOrEmpty(query))
|
||||
{
|
||||
var filtered = results.Where
|
||||
var filtered = results.Select(x => x.Clone()).Where
|
||||
(
|
||||
r =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue