mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Somil55/merge wpf to master (#3840)
* Basic WPF searchbox working * Updated key navigation and removed coldstart for searhbox * refactored and added code back in commented * Removed XAML Island references * Basic searchbox+listview working * Getting a bit more back * got color there * Result list bit better now * Added image loader for WPF Image * Partially got the context menus rendering again * adjusting coldstart to load, control will load with main form * getting context menus back * mouse over works now * Click now works, started to remove Win.XAML references * being a bit more forcusful on focus * Shadow text is not aligned * fixing focus if listbox was used * small tweak to fix shadow text * inputs don't work but gotta figure out why. commenting out * preview text * adding back in delay * fixed height issue * Applied the correct context button styles * Created custom ItemContainerStyle to fix the blue highlights behind the command buttons * Applied the correct highlight / mouseover styling * Removed vertical scrollbar in listview * fixed for alt-space prompt * Fixed right click focus issue * Somil55/wpf modifier keys (#3378) * Removed DPI change as it was not required * Global key hooks for context menu items * Updated Key for shell, folder and indexer plugin * Updated key mapping for indexer plugin * Somil55/wpf context menu selection (#3389) * Removed DPI change as it was not required * Global key hooks for context menu items * Updated Key for shell, folder and indexer plugin * Updated key mapping for indexer plugin * Add trigger to selection on tabbing * Minor shadow adjustments so its more similiar to default shell shadow. Added intro/outro animations * Added UWP-like scrollbar style for the results list * Fixed formating and naming * Removed Powerlauncher UI project * Update PowerToys.sln * Commented out scrollbar and fade in/out animations * Added missing features from UWP branch * Fixed formatting for Product.wxs * Add dragging to WPF window Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
committed by
GitHub
parent
5680a34ec1
commit
397b1533f0
@@ -9,6 +9,7 @@ using Wox.Infrastructure.Image;
|
||||
using Wox.Plugin.SharedCommands;
|
||||
using Wox.Plugin;
|
||||
using System.Reflection;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Microsoft.Plugin.Folder
|
||||
{
|
||||
@@ -40,8 +41,8 @@ namespace Microsoft.Plugin.Folder
|
||||
Glyph = "\xE8C8",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
SubTitle = $"Copy the current {fileOrFolder} path to clipboard",
|
||||
AcceleratorKey = "C",
|
||||
AcceleratorModifiers = "Control",
|
||||
AcceleratorKey = Key.C,
|
||||
AcceleratorModifiers = ModifierKeys.Control,
|
||||
Action = (context) =>
|
||||
{
|
||||
try
|
||||
@@ -71,8 +72,8 @@ namespace Microsoft.Plugin.Folder
|
||||
Title = "Open containing folder",
|
||||
Glyph = "\xE838",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "E",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
AcceleratorKey = Key.E,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
try
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Windows;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Plugin;
|
||||
using Microsoft.Plugin.Indexer.SearchHelper;
|
||||
using System.Windows.Input;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.Plugin.Indexer
|
||||
@@ -45,8 +46,8 @@ namespace Microsoft.Plugin.Indexer
|
||||
Glyph = "\xE8C8",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
SubTitle = $"Copy the current {fileOrFolder} path to clipboard",
|
||||
AcceleratorKey = "C",
|
||||
AcceleratorModifiers = "Control",
|
||||
AcceleratorKey = Key.C,
|
||||
AcceleratorModifiers = ModifierKeys.Control,
|
||||
|
||||
Action = (context) =>
|
||||
{
|
||||
@@ -77,8 +78,8 @@ namespace Microsoft.Plugin.Indexer
|
||||
Title = "Open containing folder",
|
||||
Glyph = "\xE838",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "E",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
AcceleratorKey = Key.E,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
try
|
||||
|
||||
@@ -13,14 +13,15 @@ using Windows.Management.Deployment;
|
||||
using Wox.Infrastructure;
|
||||
using Microsoft.Plugin.Program.Logger;
|
||||
using Rect = System.Windows.Rect;
|
||||
using Windows.UI.Xaml.Media.Imaging;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Plugin;
|
||||
using System.Reflection;
|
||||
using Wox.Plugin.SharedCommands;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Wox.Plugin;
|
||||
using System.Windows.Input;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using Wox.Plugin.SharedCommands;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.Plugin.Program.Programs
|
||||
{
|
||||
[Serializable]
|
||||
@@ -65,15 +66,15 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
var hResult = SHCreateStreamOnFileEx(path, exclusiveRead, noAttribute, false, null, out stream);
|
||||
|
||||
if (hResult == Hresult.Ok)
|
||||
{
|
||||
var apps = new List<Application>();
|
||||
|
||||
List<AppxPackageHelper.IAppxManifestApplication> _apps = _helper.getAppsFromManifest(stream);
|
||||
foreach(var _app in _apps)
|
||||
{
|
||||
var app = new Application(_app, this);
|
||||
apps.Add(app);
|
||||
}
|
||||
{
|
||||
var apps = new List<Application>();
|
||||
|
||||
List<AppxPackageHelper.IAppxManifestApplication> _apps = _helper.getAppsFromManifest(stream);
|
||||
foreach(var _app in _apps)
|
||||
{
|
||||
var app = new Application(_app, this);
|
||||
apps.Add(app);
|
||||
}
|
||||
|
||||
Apps = apps.Where(a => a.AppListEntry != "none").ToArray();
|
||||
}
|
||||
@@ -308,50 +309,49 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
{
|
||||
var contextMenus = new List<ContextMenuResult>();
|
||||
|
||||
if (CanRunElevated)
|
||||
{
|
||||
contextMenus.Add(
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
|
||||
Title = api.GetTranslation("wox_plugin_program_run_as_administrator"),
|
||||
Glyph = "\xE7EF",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "Enter",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
Action = _ =>
|
||||
{
|
||||
string command = "shell:AppsFolder\\" + UniqueIdentifier;
|
||||
command.Trim();
|
||||
command = Environment.ExpandEnvironmentVariables(command);
|
||||
|
||||
var info = ShellCommand.SetProcessStartInfo(command, verb: "runas");
|
||||
info.UseShellExecute = true;
|
||||
|
||||
Process.Start(info);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
contextMenus.Add(
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
|
||||
Title = api.GetTranslation("wox_plugin_program_open_containing_folder"),
|
||||
Glyph = "\xE838",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "E",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
Action = _ =>
|
||||
{
|
||||
Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", Package.Location));
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (CanRunElevated)
|
||||
{
|
||||
contextMenus.Add(
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
|
||||
Title = api.GetTranslation("wox_plugin_program_run_as_administrator"),
|
||||
Glyph = "\xE7EF",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = Key.Enter,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
string command = "shell:AppsFolder\\" + UniqueIdentifier;
|
||||
command.Trim();
|
||||
command = Environment.ExpandEnvironmentVariables(command);
|
||||
|
||||
var info = ShellCommand.SetProcessStartInfo(command, verb: "runas");
|
||||
info.UseShellExecute = true;
|
||||
|
||||
Process.Start(info);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
contextMenus.Add(
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
|
||||
Title = api.GetTranslation("wox_plugin_program_open_containing_folder"),
|
||||
Glyph = "\xE838",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = Key.E,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", Package.Location));
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return contextMenus;
|
||||
}
|
||||
|
||||
@@ -393,15 +393,15 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
manifestApp.GetStringValue("BackgroundColor", out tmpBackgroundColor);
|
||||
manifestApp.GetStringValue("EntryPoint", out tmpEntryPoint);
|
||||
|
||||
UserModelId = tmpUserModelId;
|
||||
UniqueIdentifier = tmpUniqueIdentifier;
|
||||
DisplayName = tmpDisplayName;
|
||||
Description = tmpDescription;
|
||||
BackgroundColor = tmpBackgroundColor;
|
||||
EntryPoint = tmpEntryPoint;
|
||||
|
||||
UserModelId = tmpUserModelId;
|
||||
UniqueIdentifier = tmpUniqueIdentifier;
|
||||
DisplayName = tmpDisplayName;
|
||||
Description = tmpDescription;
|
||||
BackgroundColor = tmpBackgroundColor;
|
||||
EntryPoint = tmpEntryPoint;
|
||||
|
||||
Package = package;
|
||||
|
||||
|
||||
DisplayName = ResourceFromPri(package.FullName, DisplayName);
|
||||
Description = ResourceFromPri(package.FullName, Description);
|
||||
LogoUri = LogoUriFromManifest(manifestApp);
|
||||
@@ -411,25 +411,25 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
CanRunElevated = IfApplicationcanRunElevated();
|
||||
}
|
||||
|
||||
private bool IfApplicationcanRunElevated()
|
||||
{
|
||||
if (EntryPoint == "Windows.FullTrustApplication")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var manifest = Package.Location + "\\AppxManifest.xml";
|
||||
if (File.Exists(manifest))
|
||||
{
|
||||
var file = File.ReadAllText(manifest);
|
||||
if(file.Contains("TrustLevel=\"mediumIL\"", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
private bool IfApplicationcanRunElevated()
|
||||
{
|
||||
if (EntryPoint == "Windows.FullTrustApplication")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var manifest = Package.Location + "\\AppxManifest.xml";
|
||||
if (File.Exists(manifest))
|
||||
{
|
||||
var file = File.ReadAllText(manifest);
|
||||
if(file.Contains("TrustLevel=\"mediumIL\"", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal string ResourceFromPri(string packageFullName, string resourceReference)
|
||||
|
||||
@@ -11,8 +11,9 @@ using Microsoft.Win32;
|
||||
using Wox.Infrastructure;
|
||||
using Microsoft.Plugin.Program.Logger;
|
||||
using Wox.Plugin;
|
||||
using System.Reflection;
|
||||
|
||||
using System.Windows.Input;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.Plugin.Program.Programs
|
||||
{
|
||||
|
||||
@@ -100,8 +101,8 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
Title = api.GetTranslation("wox_plugin_program_run_as_administrator"),
|
||||
Glyph = "\xE7EF",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "Enter",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
AcceleratorKey = Key.Enter,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
var info = new ProcessStartInfo
|
||||
@@ -123,8 +124,8 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
Title = api.GetTranslation("wox_plugin_program_open_containing_folder"),
|
||||
Glyph = "\xE838",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "E",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
AcceleratorKey = Key.E,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = _ =>
|
||||
{
|
||||
|
||||
@@ -260,9 +261,9 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
}
|
||||
|
||||
var files = new List<string>();
|
||||
var folderQueue = new Queue<string>();
|
||||
folderQueue.Enqueue(directory);
|
||||
|
||||
var folderQueue = new Queue<string>();
|
||||
folderQueue.Enqueue(directory);
|
||||
|
||||
do
|
||||
{
|
||||
var currentDirectory = folderQueue.Dequeue();
|
||||
|
||||
@@ -18,6 +18,7 @@ using Wox.Plugin;
|
||||
using Application = System.Windows.Application;
|
||||
using Control = System.Windows.Controls.Control;
|
||||
using Keys = System.Windows.Forms.Keys;
|
||||
using System.Windows.Input;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.Plugin.Shell
|
||||
@@ -346,8 +347,8 @@ namespace Microsoft.Plugin.Shell
|
||||
Title = _context.API.GetTranslation("wox_plugin_cmd_run_as_administrator"),
|
||||
Glyph = "\xE7EF",
|
||||
FontFamily = "Segoe MDL2 Assets",
|
||||
AcceleratorKey = "Enter",
|
||||
AcceleratorModifiers = "Control,Shift",
|
||||
AcceleratorKey = Key.Enter,
|
||||
AcceleratorModifiers = (ModifierKeys.Control | ModifierKeys.Shift),
|
||||
Action = c =>
|
||||
{
|
||||
Execute(Process.Start, PrepareProcessStartInfo(selectedResult.Title, true));
|
||||
|
||||
Reference in New Issue
Block a user