diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs index 88a652a068..1804c38bb9 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs @@ -93,7 +93,6 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel } List panelItems = results.OrderByDescending(o => o.Score).Take(5).ToList(); - panelItems.ForEach(o => o.Score = 0); return panelItems; } diff --git a/Wox.Plugin.SystemPlugins/Program/Programs.cs b/Wox.Plugin.SystemPlugins/Program/Programs.cs index e4fe5e841f..c93d2e71df 100644 --- a/Wox.Plugin.SystemPlugins/Program/Programs.cs +++ b/Wox.Plugin.SystemPlugins/Program/Programs.cs @@ -65,7 +65,7 @@ namespace Wox.Plugin.SystemPlugins.Program Title = c.Title, SubTitle = c.ExecutePath, IcoPath = c.IcoPath, - Score = 0, + Score = c.Score, Action = (e) => { context.API.HideApp(); @@ -77,9 +77,9 @@ namespace Wox.Plugin.SystemPlugins.Program private bool MatchProgram(Program program, FuzzyMatcher matcher) { - if (program.AbbrTitle != null && (program.Score = matcher.Evaluate(program.AbbrTitle).Score) > 0) return true; if ((program.Score = matcher.Evaluate(program.Title).Score) > 0) return true; if ((program.Score = matcher.Evaluate(program.PinyinTitle).Score) > 0) return true; + if (program.AbbrTitle != null && (program.Score = matcher.Evaluate(program.AbbrTitle).Score) > 0) return true; if (program.ExecuteName != null && (program.Score = matcher.Evaluate(program.ExecuteName).Score) > 0) return true; return false; diff --git a/Wox.Plugin.SystemPlugins/Sys/Sys.cs b/Wox.Plugin.SystemPlugins/Sys/Sys.cs index ccd9ca6780..50a2a6e859 100644 --- a/Wox.Plugin.SystemPlugins/Sys/Sys.cs +++ b/Wox.Plugin.SystemPlugins/Sys/Sys.cs @@ -51,14 +51,11 @@ namespace Wox.Plugin.SystemPlugins.Sys #endregion - public System.Windows.Controls.Control CreateSettingPanel() { return new SysSettings(availableResults); } - - protected override List QueryInternal(Query query) { if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List(); @@ -96,7 +93,7 @@ namespace Wox.Plugin.SystemPlugins.Sys { Title = "Log off", SubTitle = "Log off current user", - Score = 20, + Score = 100, IcoPath = "Images\\logoff.png", Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0) }, @@ -104,7 +101,7 @@ namespace Wox.Plugin.SystemPlugins.Sys { Title = "Lock", SubTitle = "Lock this computer", - Score = 20, + Score = 100, IcoPath = "Images\\lock.png", Action = (c) => { @@ -146,7 +143,7 @@ namespace Wox.Plugin.SystemPlugins.Sys { Title = "Settings", SubTitle = "Tweak this app", - Score = 40, + Score = 100, IcoPath = "Images\\app.png", Action = (c) => { diff --git a/Wox/ResultPanel.xaml.cs b/Wox/ResultPanel.xaml.cs index b65ae4f42d..690a48de69 100644 --- a/Wox/ResultPanel.xaml.cs +++ b/Wox/ResultPanel.xaml.cs @@ -70,29 +70,6 @@ namespace Wox return location; } - private FrameworkElement FindByName(string name, FrameworkElement root) - { - Stack tree = new Stack(); - tree.Push(root); - - while (tree.Count > 0) - { - FrameworkElement current = tree.Pop(); - if (current.Name == name) - return current; - - int count = VisualTreeHelper.GetChildrenCount(current); - for (int i = 0; i < count; ++i) - { - DependencyObject child = VisualTreeHelper.GetChild(current, i); - if (child is FrameworkElement) - tree.Push((FrameworkElement)child); - } - } - - return null; - } - public void SelectNext() { int index = lbResults.SelectedIndex;