update subtitle's setting type display to System settings/Control Panel

This commit is contained in:
Jeremy 2021-12-02 21:33:05 +11:00
parent 0b725eb02c
commit aad4fc1973

View file

@ -91,7 +91,7 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
{
Action = _ => DoOpenSettingsAction(entry),
IcoPath = type == "AppSettingsApp" ? windowsSettingIconPath : controlPanelIconPath,
SubTitle = $"{Resources.Area} \"{entry.Area}\" {Resources.SubtitlePreposition} {entry.Type}",
SubTitle = GetSubtitle(entry.Area, type),
Title = entry.Name + entry.glyph,
ContextData = entry,
Score = score
@ -101,6 +101,13 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
return resultList;
}
private static string GetSubtitle(string section, string entryType)
{
var settingType = entryType == "AppSettingsApp" ? "System settings" : "Control Panel";
return $"{settingType} > {section}";
}
/// <summary>
/// Add a tool-tip to the given <see cref="Result"/>, based o the given <see cref="IWindowsSetting"/>.
/// </summary>
@ -109,8 +116,10 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
private static void AddOptionalToolTip(WindowsSetting entry, Result result)
{
var toolTipText = new StringBuilder();
var settingType = entry.Type == "AppSettingsApp" ? "System settings" : "Control Panel";
toolTipText.AppendLine($"{Resources.Application}: {entry.Type}");
toolTipText.AppendLine($"{Resources.Application}: {settingType}");
toolTipText.AppendLine($"{Resources.Area}: {entry.Area}");
if (entry.AltNames != null && entry.AltNames.Any())