mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Remove all explicit dependencies from the toolkit and extensions api on WinAppSDK (#41261)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> This pull request removes the dependencies from the toolkit and the SDK on WinAppSDK and WebView2. This allows clients of these APIs to have their own version dependencies. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ X] Closes: #41235 - [ X] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ X] **Tests:** Added/updated and all pass - [ X] **Localization:** All end-user-facing strings can be localized - [ X] **Dev docs:** Added/updated - [ X] **New binaries:** Added on the required places - [ X] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ X] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ X] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ X] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ X] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx Co-authored-by: Ross Luengen <rossl@microsoft.com>
This commit is contained in:
@@ -8,7 +8,6 @@ using Microsoft.CmdPal.Ext.WindowsTerminal.Helpers;
|
|||||||
using Microsoft.CmdPal.Ext.WindowsTerminal.Properties;
|
using Microsoft.CmdPal.Ext.WindowsTerminal.Properties;
|
||||||
using Microsoft.CommandPalette.Extensions;
|
using Microsoft.CommandPalette.Extensions;
|
||||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||||
using Microsoft.UI.Xaml.Media.Imaging;
|
|
||||||
|
|
||||||
namespace Microsoft.CmdPal.Ext.WindowsTerminal.Pages;
|
namespace Microsoft.CmdPal.Ext.WindowsTerminal.Pages;
|
||||||
|
|
||||||
@@ -16,7 +15,6 @@ internal sealed partial class ProfilesListPage : ListPage
|
|||||||
{
|
{
|
||||||
private readonly TerminalQuery _terminalQuery = new();
|
private readonly TerminalQuery _terminalQuery = new();
|
||||||
private readonly SettingsManager _terminalSettings;
|
private readonly SettingsManager _terminalSettings;
|
||||||
private readonly Dictionary<string, BitmapImage> _logoCache = [];
|
|
||||||
|
|
||||||
private bool showHiddenProfiles;
|
private bool showHiddenProfiles;
|
||||||
private bool openNewTab;
|
private bool openNewTab;
|
||||||
@@ -54,14 +52,6 @@ internal sealed partial class ProfilesListPage : ListPage
|
|||||||
MoreCommands = [
|
MoreCommands = [
|
||||||
new CommandContextItem(new LaunchProfileAsAdminCommand(profile.Terminal.AppUserModelId, profile.Name, openNewTab, openQuake)),
|
new CommandContextItem(new LaunchProfileAsAdminCommand(profile.Terminal.AppUserModelId, profile.Name, openNewTab, openQuake)),
|
||||||
],
|
],
|
||||||
|
|
||||||
// Icon = () => GetLogo(profile.Terminal),
|
|
||||||
// Action = _ =>
|
|
||||||
// {
|
|
||||||
// Launch(profile.Terminal.AppUserModelId, profile.Name);
|
|
||||||
// return true;
|
|
||||||
// },
|
|
||||||
// ContextData = profile,
|
|
||||||
#pragma warning restore SA1108
|
#pragma warning restore SA1108
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -70,17 +60,4 @@ internal sealed partial class ProfilesListPage : ListPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override IListItem[] GetItems() => Query().ToArray();
|
public override IListItem[] GetItems() => Query().ToArray();
|
||||||
|
|
||||||
private BitmapImage GetLogo(TerminalPackage terminal)
|
|
||||||
{
|
|
||||||
var aumid = terminal.AppUserModelId;
|
|
||||||
|
|
||||||
if (!_logoCache.TryGetValue(aumid, out var value))
|
|
||||||
{
|
|
||||||
value = terminal.GetLogo();
|
|
||||||
_logoCache.Add(aumid, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.UI.Xaml.Media.Imaging;
|
|
||||||
|
|
||||||
// using Wox.Infrastructure.Image;
|
// using Wox.Infrastructure.Image;
|
||||||
namespace Microsoft.CmdPal.Ext.WindowsTerminal;
|
namespace Microsoft.CmdPal.Ext.WindowsTerminal;
|
||||||
@@ -30,23 +29,4 @@ public class TerminalPackage
|
|||||||
SettingsPath = settingsPath;
|
SettingsPath = settingsPath;
|
||||||
LogoPath = logoPath;
|
LogoPath = logoPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BitmapImage GetLogo()
|
|
||||||
{
|
|
||||||
var image = new BitmapImage();
|
|
||||||
|
|
||||||
if (File.Exists(LogoPath))
|
|
||||||
{
|
|
||||||
using var fileStream = File.OpenRead(LogoPath);
|
|
||||||
image.SetSource(fileStream.AsRandomAccessStream());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Not using wox anymore, TODO: find the right new way to handle this
|
|
||||||
// image.UriSource = new Uri(ImageLoader.ErrorIconPath);
|
|
||||||
Logger.LogError($"Logo file not found: {LogoPath}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,6 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" />
|
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" />
|
|
||||||
<PackageReference Include="System.Drawing.Common" />
|
<PackageReference Include="System.Drawing.Common" />
|
||||||
<!-- This line forces the WebView2 version used by Windows App SDK to be the one we expect from Directory.Packages.props . -->
|
<!-- This line forces the WebView2 version used by Windows App SDK to be the one we expect from Directory.Packages.props . -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -180,4 +180,4 @@
|
|||||||
<Error Condition="!Exists('$(WasdkNuget)\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(WasdkNuget)\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
<Error Condition="!Exists('$(WasdkNuget)\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(WasdkNuget)\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
||||||
<Error Condition="!Exists('$(WebView2Nuget)\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(WebView2Nuget)\build\native\Microsoft.Web.WebView2.targets'))" />
|
<Error Condition="!Exists('$(WebView2Nuget)\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(WebView2Nuget)\build\native\Microsoft.Web.WebView2.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Web.WebView2" version="1.0.2903.40" targetFramework="native" />
|
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
|
||||||
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.26100.4188" targetFramework="native" />
|
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.26100.4188" targetFramework="native" />
|
||||||
<package id="Microsoft.WindowsAppSDK" version="1.7.250513003" targetFramework="native" />
|
|
||||||
</packages>
|
</packages>
|
||||||
Reference in New Issue
Block a user