diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/de.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/de.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/de.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/de.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/en.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/en.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/en.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/en.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/ja.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/ja.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/ja.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/ja.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/pl.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/pl.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/pl.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/pl.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/tr.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/tr.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/tr.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/tr.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-cn.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-cn.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-cn.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-cn.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-tw.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-tw.xaml index f3f4dfe682..28408b166c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-tw.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Languages/zh-tw.xaml @@ -4,5 +4,7 @@ Copy path (Ctrl+C) Open containing folder (Ctrl+Shift+E) + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs index b010e866d3..f03878e2a7 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs @@ -65,7 +65,8 @@ namespace Microsoft.Plugin.Indexer foreach (var searchResult in searchResultsList) { var path = searchResult.Path; - + var toolTipTitle = string.Format("{0} : {1}", _context.API.GetTranslation("Microsoft_plugin_indexer_name"), searchResult.Title); + var toolTipText = string.Format("{0} : {1}", _context.API.GetTranslation("Microsoft_plugin_indexer_path"), path); string workingDir = null; if (_settings.UseLocationAsWorkingDir) workingDir = Path.GetDirectoryName(path); @@ -74,6 +75,7 @@ namespace Microsoft.Plugin.Indexer r.Title = searchResult.Title; r.SubTitle = "Search: " + path; r.IcoPath = path; + r.ToolTipData = new ToolTipData(toolTipTitle, toolTipText); r.Action = c => { bool hide; diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/de.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/de.xaml index fa78a9dca9..51ed267560 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/de.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/de.xaml @@ -39,5 +39,7 @@ Weblink-Anwendung Web-Anwendung Run command + Name + Path diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/en.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/en.xaml index 5701d63027..8c2a76533c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/en.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/en.xaml @@ -50,4 +50,6 @@ Internet shortcut application Web application Run command + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/ja.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/ja.xaml index cdb784b8c3..80296c9fb0 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/ja.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/ja.xaml @@ -40,5 +40,7 @@ Internet shortcut application Web application Run command + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/pl.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/pl.xaml index 603be8fc02..c31f95f985 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/pl.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/pl.xaml @@ -39,5 +39,7 @@ Internet shortcut application Web application Run command + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/tr.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/tr.xaml index ea181dbc01..3ddeb60efc 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/tr.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/tr.xaml @@ -41,5 +41,7 @@ Internet shortcut application Web application Run command + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-cn.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-cn.xaml index 5b222bc4d4..ef4f8ce7f9 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-cn.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-cn.xaml @@ -41,5 +41,7 @@ Internet shortcut application Web application Run command + Name + Path \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-tw.xaml b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-tw.xaml index 73e91ed9fe..c563efcbae 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-tw.xaml +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/zh-tw.xaml @@ -39,5 +39,7 @@ Internet shortcut application Web application Run command - + Name + Path + diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWP.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWP.cs index d62273a384..ea961247d1 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWP.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/UWP.cs @@ -301,7 +301,12 @@ namespace Microsoft.Plugin.Program.Programs { result.Title = DisplayName; result.TitleHighlightData = StringMatcher.FuzzySearch(query, DisplayName).MatchData; - } + } + + var toolTipTitle = string.Format("{0} : {1}", api.GetTranslation("powertoys_run_plugin_program_file_name"), result.Title); + var toolTipText = string.Format("{0} : {1}", api.GetTranslation("powertoys_run_plugin_program_file_path"), Package.Location); + result.ToolTipData = new ToolTipData(toolTipTitle, toolTipText); + return result; } diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32.cs index abecdf7880..48444e4956 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32.cs @@ -199,6 +199,10 @@ namespace Microsoft.Plugin.Program.Programs result.TitleHighlightData = StringMatcher.FuzzySearch(query, Name).MatchData; } + var toolTipTitle = string.Format("{0} : {1}", api.GetTranslation("powertoys_run_plugin_program_file_name"), result.Title); + var toolTipText = string.Format("{0} : {1}", api.GetTranslation("powertoys_run_plugin_program_file_path"), FullPath); + result.ToolTipData = new ToolTipData(toolTipTitle, toolTipText); + return result; } diff --git a/src/modules/launcher/PowerLauncher/ResultList.xaml b/src/modules/launcher/PowerLauncher/ResultList.xaml index f193d419f4..5573291527 100644 --- a/src/modules/launcher/PowerLauncher/ResultList.xaml +++ b/src/modules/launcher/PowerLauncher/ResultList.xaml @@ -113,6 +113,13 @@ + @@ -137,7 +144,13 @@ - + @@ -155,6 +168,26 @@ + + + + + + + + diff --git a/src/modules/launcher/PowerLauncher/Themes/Dark.xaml b/src/modules/launcher/PowerLauncher/Themes/Dark.xaml index aba7d05776..5fa7429ee3 100644 --- a/src/modules/launcher/PowerLauncher/Themes/Dark.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/Dark.xaml @@ -43,4 +43,8 @@ #FF313131 #FFa4a4a4 + + + + \ No newline at end of file diff --git a/src/modules/launcher/PowerLauncher/Themes/HighContrast1.xaml b/src/modules/launcher/PowerLauncher/Themes/HighContrast1.xaml index 573998249a..62527f49ae 100644 --- a/src/modules/launcher/PowerLauncher/Themes/HighContrast1.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/HighContrast1.xaml @@ -43,4 +43,8 @@ #FF000000 #FF000000 + + + + \ No newline at end of file diff --git a/src/modules/launcher/PowerLauncher/Themes/HighContrast2.xaml b/src/modules/launcher/PowerLauncher/Themes/HighContrast2.xaml index 2c73c73e84..1251c94ae0 100644 --- a/src/modules/launcher/PowerLauncher/Themes/HighContrast2.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/HighContrast2.xaml @@ -43,4 +43,8 @@ #FF000000 #FF000000 + + + + \ No newline at end of file diff --git a/src/modules/launcher/PowerLauncher/Themes/HighContrastBlack.xaml b/src/modules/launcher/PowerLauncher/Themes/HighContrastBlack.xaml index 9808c0f31a..ce77f4c3e3 100644 --- a/src/modules/launcher/PowerLauncher/Themes/HighContrastBlack.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/HighContrastBlack.xaml @@ -42,5 +42,8 @@ #FF000000 #FF000000 - + + + + \ No newline at end of file diff --git a/src/modules/launcher/PowerLauncher/Themes/HighContrastWhite.xaml b/src/modules/launcher/PowerLauncher/Themes/HighContrastWhite.xaml index 23d03fe6f6..dd916068bb 100644 --- a/src/modules/launcher/PowerLauncher/Themes/HighContrastWhite.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/HighContrastWhite.xaml @@ -42,4 +42,8 @@ #FF000000 #FF000000 + + + + \ No newline at end of file diff --git a/src/modules/launcher/PowerLauncher/Themes/Light.xaml b/src/modules/launcher/PowerLauncher/Themes/Light.xaml index 850f39a4ec..2c6931847c 100644 --- a/src/modules/launcher/PowerLauncher/Themes/Light.xaml +++ b/src/modules/launcher/PowerLauncher/Themes/Light.xaml @@ -42,4 +42,8 @@ #FFd2d2d2 #FF5d5d5d + + + + \ No newline at end of file diff --git a/src/modules/launcher/Wox.Plugin/Result.cs b/src/modules/launcher/Wox.Plugin/Result.cs index 9cd358c623..196ee68ad3 100644 --- a/src/modules/launcher/Wox.Plugin/Result.cs +++ b/src/modules/launcher/Wox.Plugin/Result.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Windows.Media; +using System.Windows; namespace Wox.Plugin { @@ -9,14 +10,37 @@ namespace Wox.Plugin public class Result { + private string _title; + private ToolTipData _toolTipData; private string _pluginDirectory; private string _icoPath; - public string Title { get; set; } + public string Title { + get { return _title; } + set + { + _title = value.Replace("\n", " "); + } + } public string SubTitle { get; set; } public string Glyph { get; set; } - public string FontFamily { get; set; } + public string FontFamily { get; set; } + + public Visibility ToolTipVisibility { get; set; } = Visibility.Collapsed; + + public ToolTipData ToolTipData + { + get + { + return _toolTipData; + } + set + { + _toolTipData = value; + ToolTipVisibility = Visibility.Visible; + } + } /// /// The text that will get displayed in the Search text box, when this item is selected in the result list. diff --git a/src/modules/launcher/Wox.Plugin/ToolTipData.cs b/src/modules/launcher/Wox.Plugin/ToolTipData.cs new file mode 100644 index 0000000000..2051a081b7 --- /dev/null +++ b/src/modules/launcher/Wox.Plugin/ToolTipData.cs @@ -0,0 +1,21 @@ +using System; + +namespace Wox.Plugin +{ + public class ToolTipData + { + public string Title { get; private set; } + + public string Text { get; private set; } + + public ToolTipData(string title, string text) + { + if(string.IsNullOrEmpty(title)) + { + throw new ArgumentException("title cannot be null or empty", "title"); + } + Title = title; + Text = text; + } + } +} diff --git a/src/modules/launcher/Wox.Test/Plugins/ResultTest.cs b/src/modules/launcher/Wox.Test/Plugins/ResultTest.cs new file mode 100644 index 0000000000..8782c9c660 --- /dev/null +++ b/src/modules/launcher/Wox.Test/Plugins/ResultTest.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using Wox.Plugin; + +namespace Wox.Test.Plugins +{ + [TestFixture] + class ResultTest + { + [Test] + public void Result_UpdatesToolTipVisibilityToVisible_WhenToolTipDataIsSet() + { + // Arrange + Result res = new Result(); + string toolTipText = "ToolTipText"; + + // Act + res.ToolTipData = new ToolTipData(toolTipText, string.Empty); + + // Assert + Assert.AreEqual(res.ToolTipVisibility, Visibility.Visible); + } + + [Test] + public void Result_UpdatesToolTipVisibilityToCollapsed_WhenToolTipDataIsNotSet() + { + // Act + Result res = new Result(); + + // Assert + Assert.AreEqual(res.ToolTipVisibility, Visibility.Collapsed); + } + } +} diff --git a/src/modules/launcher/Wox.Test/Plugins/ToolTipDataTest.cs b/src/modules/launcher/Wox.Test/Plugins/ToolTipDataTest.cs new file mode 100644 index 0000000000..f9fa1a1140 --- /dev/null +++ b/src/modules/launcher/Wox.Test/Plugins/ToolTipDataTest.cs @@ -0,0 +1,23 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Text; +using Wox.Plugin; + +namespace Wox.Test.Plugins +{ + [TestFixture] + class ToolTipDataTest + { + [Test] + public void Constructor_ThrowsNullArgumentException_WhenToolTipTitleIsNull() + { + // Arrange + string title = null; + string text = "text"; + + // Assert + var ex = Assert.Throws(() => new ToolTipData(title, text)); + } + } +}