add tooltips to vscode workspaces plugin (#10348)

This commit is contained in:
ricardosantos9521 2021-03-23 09:32:55 +00:00 committed by GitHub
parent 730e5f299f
commit 55cfaaf929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,11 +49,14 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
title += $" - {(a.ExtraInfo != null ? $"{a.ExtraInfo} ({typeWorkspace})" : typeWorkspace)}";
}
var tooltip = new ToolTipData(title, $"{Resources.Workspace}{(a.TypeWorkspace != TypeWorkspace.Local ? $" {Resources.In} {typeWorkspace}" : "")}: {SystemPath.RealPath(a.RelativePath)}");
results.Add(new Result
{
Title = title,
SubTitle = $"{Resources.Workspace}{(a.TypeWorkspace != TypeWorkspace.Local ? $" {Resources.In} {typeWorkspace}" : "")}: {SystemPath.RealPath(a.RelativePath)}",
Icon = a.VSCodeInstance.WorkspaceIcon,
ToolTipData = tooltip,
Action = c =>
{
bool hide;
@ -83,6 +86,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
});
});
// Search opened remote machines
_machinesApi.Machines.ForEach(a =>
{
@ -93,11 +97,14 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
title += $" [{a.User}@{a.HostName}]";
}
var tooltip = new ToolTipData(title, Resources.SSHRemoteMachine);
results.Add(new Result
{
Title = title,
SubTitle = Resources.SSHRemoteMachine,
Icon = a.VSCodeInstance.RemoteIcon,
ToolTipData = tooltip,
Action = c =>
{
bool hide;