mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve option logic
This commit is contained in:
parent
814afc75dd
commit
0cbd7ba1e2
1 changed files with 28 additions and 8 deletions
|
|
@ -81,7 +81,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
// Filter processes based on search term
|
// Filter processes based on search term
|
||||||
var searchTerm = query.Search;
|
var searchTerm = query.Search;
|
||||||
var processlist = new List<ProcessResult>();
|
var processlist = new List<ProcessResult>();
|
||||||
var processWindowTitle = Settings.ShowWindowTitle ?
|
var processWindowTitle =
|
||||||
|
Settings.ShowWindowTitle || Settings.PutVisibleWindowProcessesTop ?
|
||||||
ProcessHelper.GetProcessesWithNonEmptyWindowTitle() :
|
ProcessHelper.GetProcessesWithNonEmptyWindowTitle() :
|
||||||
new Dictionary<int, string>();
|
new Dictionary<int, string>();
|
||||||
if (string.IsNullOrWhiteSpace(searchTerm))
|
if (string.IsNullOrWhiteSpace(searchTerm))
|
||||||
|
|
@ -93,12 +94,22 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
if (processWindowTitle.TryGetValue(p.Id, out var windowTitle))
|
if (processWindowTitle.TryGetValue(p.Id, out var windowTitle))
|
||||||
{
|
{
|
||||||
// Add score to prioritize processes with visible windows
|
// Add score to prioritize processes with visible windows
|
||||||
// And use window title for those processes
|
// Use window title for those processes if enabled
|
||||||
processlist.Add(new ProcessResult(p, Settings.PutVisibleWindowProcessesTop ? 200 : 0, windowTitle, null, progressNameIdTitle));
|
processlist.Add(new ProcessResult(
|
||||||
|
p,
|
||||||
|
Settings.PutVisibleWindowProcessesTop ? 200 : 0,
|
||||||
|
Settings.ShowWindowTitle ? windowTitle : progressNameIdTitle,
|
||||||
|
null,
|
||||||
|
progressNameIdTitle));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
processlist.Add(new ProcessResult(p, 0, progressNameIdTitle, null, progressNameIdTitle));
|
processlist.Add(new ProcessResult(
|
||||||
|
p,
|
||||||
|
0,
|
||||||
|
progressNameIdTitle,
|
||||||
|
null,
|
||||||
|
progressNameIdTitle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -117,13 +128,17 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
if (score > 0)
|
if (score > 0)
|
||||||
{
|
{
|
||||||
// Add score to prioritize processes with visible windows
|
// Add score to prioritize processes with visible windows
|
||||||
// And use window title for those processes
|
// Use window title for those processes
|
||||||
if (Settings.PutVisibleWindowProcessesTop)
|
if (Settings.PutVisibleWindowProcessesTop)
|
||||||
{
|
{
|
||||||
score += 200;
|
score += 200;
|
||||||
}
|
}
|
||||||
processlist.Add(new ProcessResult(p, score, windowTitle,
|
processlist.Add(new ProcessResult(
|
||||||
score == windowTitleMatch.Score ? windowTitleMatch : null, progressNameIdTitle));
|
p,
|
||||||
|
score,
|
||||||
|
Settings.ShowWindowTitle ? windowTitle : progressNameIdTitle,
|
||||||
|
score == windowTitleMatch.Score ? windowTitleMatch : null,
|
||||||
|
progressNameIdTitle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -132,7 +147,12 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
||||||
var score = processNameIdMatch.Score;
|
var score = processNameIdMatch.Score;
|
||||||
if (score > 0)
|
if (score > 0)
|
||||||
{
|
{
|
||||||
processlist.Add(new ProcessResult(p, score, progressNameIdTitle, processNameIdMatch, progressNameIdTitle));
|
processlist.Add(new ProcessResult(
|
||||||
|
p,
|
||||||
|
score,
|
||||||
|
progressNameIdTitle,
|
||||||
|
processNameIdMatch,
|
||||||
|
progressNameIdTitle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue