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