Merge remote-tracking branch 'origin/main' into dev/snickler/net8-upgrade

This commit is contained in:
Jeremy Sinclair 2023-10-31 11:12:44 -04:00
commit 1bbabb84f8
119 changed files with 1770 additions and 1954 deletions

View File

@ -51,6 +51,7 @@ body:
- Awake
- ColorPicker
- Crop and Lock
- Environment Variables
- FancyZones
- FancyZones Editor
- File Locksmith

View File

@ -25,6 +25,7 @@ body:
- Awake
- ColorPicker
- Crop and Lock
- Environment Variables
- FancyZones
- FancyZones Editor
- File Locksmith

View File

@ -1945,6 +1945,7 @@ tlbimp
TMPVAR
TNP
toggleswitch
tonos
toolkitcontrols
toolkitconverters
Toolset

View File

@ -107,7 +107,7 @@ if (-not $Passive)
else
{
Write-Output "Checking all files (passively)"
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)|(\\settings-ui\\Settings.UI\\)" }
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\Generated Files\\PowerRenameXAML\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)" }
if ($files.count -gt 0)
{

188
README.md
View File

@ -18,13 +18,13 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
| | Current utilities: | |
|--------------|--------------------|--------------|
| [Always on Top](https://aka.ms/PowerToysOverview_AoT) | [PowerToys Awake](https://aka.ms/PowerToysOverview_Awake) | [Color Picker](https://aka.ms/PowerToysOverview_ColorPicker) |
| [Crop And Lock](https://aka.ms/PowerToysOverview_CropAndLock) | [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) | [File Explorer Add-ons](https://aka.ms/PowerToysOverview_FileExplorerAddOns) |
| [File Locksmith](https://aka.ms/PowerToysOverview_FileLocksmith) | [Hosts File Editor](https://aka.ms/PowerToysOverview_HostsFileEditor) | [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) |
| [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) | [Mouse utilities](https://aka.ms/PowerToysOverview_MouseUtilities) | [Mouse Without Borders](https://aka.ms/PowerToysOverview_MouseWithoutBorders) |
| [Peek](https://aka.ms/PowerToysOverview_Peek) | [Paste as Plain Text](https://aka.ms/PowerToysOverview_PastePlain) | [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) |
| [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) | [Quick Accent](https://aka.ms/PowerToysOverview_QuickAccent) | [Registry Preview](https://aka.ms/PowerToysOverview_RegistryPreview) |
| [Screen Ruler](https://aka.ms/PowerToysOverview_ScreenRuler) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) | [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) |
| [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) |
| [Crop And Lock](https://aka.ms/PowerToysOverview_CropAndLock) | [Environment Variables](https://aka.ms/PowerToysOverview_EnvironmentVariables) | [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) |
| [File Explorer Add-ons](https://aka.ms/PowerToysOverview_FileExplorerAddOns) | [File Locksmith](https://aka.ms/PowerToysOverview_FileLocksmith) | [Hosts File Editor](https://aka.ms/PowerToysOverview_HostsFileEditor) |
| [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) | [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) | [Mouse utilities](https://aka.ms/PowerToysOverview_MouseUtilities) |
| [Mouse Without Borders](https://aka.ms/PowerToysOverview_MouseWithoutBorders) | [Peek](https://aka.ms/PowerToysOverview_Peek) | [Paste as Plain Text](https://aka.ms/PowerToysOverview_PastePlain) |
| [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) | [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) | [Quick Accent](https://aka.ms/PowerToysOverview_QuickAccent) |
| [Registry Preview](https://aka.ms/PowerToysOverview_RegistryPreview) | [Screen Ruler](https://aka.ms/PowerToysOverview_ScreenRuler) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) |
| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) |
## Installing and running Microsoft PowerToys
@ -39,19 +39,19 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
Go to the [Microsoft PowerToys GitHub releases page][github-release-link] and click on `Assets` at the bottom to show the files available in the release. Please use the appropriate PowerToys installer that matches your machine's architecture and install scope. For most, it is `x64` and per-user.
<!-- items that need to be updated release to release -->
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F48
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F47
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.74.1/PowerToysUserSetup-0.74.1-x64.exe
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.74.1/PowerToysUserSetup-0.74.1-arm64.exe
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.74.1/PowerToysSetup-0.74.1-x64.exe
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.74.1/PowerToysSetup-0.74.1-arm64.exe
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F49
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F48
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.75.0/PowerToysUserSetup-0.75.0-x64.exe
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.75.0/PowerToysUserSetup-0.75.0-arm64.exe
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.75.0/PowerToysSetup-0.75.0-x64.exe
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.75.0/PowerToysSetup-0.75.0-arm64.exe
| Description | Filename | sha256 hash |
|----------------|----------|-------------|
| Per user - x64 | [PowerToysUserSetup-0.74.1-x64.exe][ptUserX64] | 748BF7BA33913237D36D6F48E3839D0C8035967305137A17DEFF39D775735C81 |
| Per user - ARM64 | [PowerToysUserSetup-0.74.1-arm64.exe][ptUserArm64] | F5DAA89A9CF3A2805E121085AFD056A890F241A170FAB5007AA58E2755C88C54 |
| Machine wide - x64 | [PowerToysSetup-0.74.1-x64.exe][ptMachineX64] | 298C6F4E4391BDC06E128BED86A303C3300A68EAF754B4630AF7542C78C0944A |
| Machine wide - ARM64 | [PowerToysSetup-0.74.1-arm64.exe][ptMachineArm64] | A65F3C300A48F9F81312B7FC7B306382CB87F591612D0CEC7E5C0E47E868904B |
| Per user - x64 | [PowerToysUserSetup-0.75.0-x64.exe][ptUserX64] | 26C746D5690472082460FED3866627B80A2B50961D77DF683C5E271054C9C97B |
| Per user - ARM64 | [PowerToysUserSetup-0.75.0-arm64.exe][ptUserArm64] | 8919FF49F3F0C4716D6F58871C9AABEB321292FDAFFB4DCCC9A8FA326D3646D2 |
| Machine wide - x64 | [PowerToysSetup-0.75.0-x64.exe][ptMachineX64] | C9C7DAB9E002CE7920107132BC98A1A89BFBA8898FC35186A6559587A8ED3C38 |
| Machine wide - ARM64 | [PowerToysSetup-0.75.0-arm64.exe][ptMachineArm64] | 28D9D9E9B69821155F870AF895DEE22866060C1CED08E2117CCBD1853C051698 |
This is our preferred method.
@ -97,147 +97,139 @@ For guidance on developing for PowerToys, please read the [developer docs](/doc/
Our [prioritized roadmap][roadmap] of features and utilities that the core team is focusing on.
### 0.74 - September 2023 Update
### 0.75 - October 2023 Update
In this release, we focused on stability and improvements.
In this release, we focused on new features, stability and improvements.
**Highlights**
- Upgraded to Windows App SDK 1.4.1, increasing stability of WinUI3 utilities. Thanks [@dongle-the-gadget](https://github.com/dongle-the-gadget) for starting the upgrade!
- Text Extractor was upgraded to its version 2.0, with a new overlay, table mode and more Quality of Life improvements. Thanks [@TheJoeFin](https://github.com/TheJoeFin)!
- Improved FancyZones stability, fixing some layout resets and improving handling of newly created windows on Windows 11.
- Fixed many silent crashes that were reported to Watson and the user's event viewer.
- New utility: An environment variables editor with the functionality to configure profiles that can be enabled/disabled. Thanks [@niels9001](https://github.com/niels9001) for the design and UI work that made this possible!
- Settings has a new Dashboard home page, with quick access for enabling modules, short descriptions and activation methods. Thanks [@niels9001](https://github.com/niels9001) for the design and UI work that made this possible!
- Added a previewer to Peek that hosts File Explorer previewers to support every file type that a machine is currently able to preview. For example, this means that if Microsoft Office handlers are installed, Peek can preview Office files. Thanks [@dillydylann](https://github.com/dillydylann)!
### General
- Turning animations off in Windows Settings will now also turn them off in PowerToys.
- Upgraded the Windows App SDK dependency to 1.4.1. Thanks [@dongle-the-gadget](https://github.com/dongle-the-gadget) for the original 1.4.0 upgrade!
- Show in the thumbnail label and application titles when running as administrator. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Upgraded the Win UI Community Toolkit dependency to 8.0. Thanks [@niels9001](https://github.com/niels9001)!
### Awake
- Added down-sampled variants to the application's icon. Thanks [@morriscurtis](https://github.com/morriscurtis)!
- Many typo fixes through the projects and documentation. Thanks [@brianteeman](https://github.com/brianteeman)!
- Refactored and improved the logic across utilities for bringing a window to the foreground after activation.
### Color Picker
- After adding a new color in the editor, the history will scroll the new color into view. Thanks [@peerpalo](https://github.com/peerpalo)!
- After activating Color Picker, it's now possible to cancel the session by clicking the right mouse button. Thanks [@fredso90](https://github.com/fredso90)!
### Crop and Lock
- Fixed a Crop and Lock crash that would occur when trying to reparent a window crashes the target application. An error message is shown instead.
### Environment Variables
- Added a new utility: An environment variables editor that has the functionality to configure profiles that can be enabled/disabled. Thanks [@niels9001](https://github.com/niels9001) for the design and UI work that made this possible!
- Shows in the title bar if it's running as an administrator. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
### FancyZones
- Set the process and main thread priority to normal.
- Fixed handling newly created windows on Windows 11.
- Fixed scenarios where opening the FancyZones Editor would reset the layouts.
- Fixed an issue causing context menu pop-ups from some apps to automatically snap to a zone. (This was a hotfix for 0.74)
- Applied the fix for the context menu pop-ups to the logic that decides which windows can be snapped.
- Reworked the "Keep windows in their zones" option to include the work area and turn it on by default, fixing an incompatibility with the Copilot flyout.
- Fixed an issue causing windows to be snapped while moving to a different virtual desktop.
### File Explorer add-ons
- Optimized CPU usage for generating SVG thumbnails.
- Improved handling of Gcode Thumbnails, including JPG and QOI formats. Thanks [@pedrolamas](https://github.com/pedrolamas)!
- Better handled errors when sending telemetry, which were causing reported crashes.
- Fixed some thumbnails not being shown centered like before the optimization.
- Fixed an issue blocking some SVG files from being previewed correctly. (This was a hotfix for 0.74)
- Fixed crashes on invalid files in the STL Thumbnail generator.
### File Locksmith
### GPO
- Shows files opened by processes with PID greater than 65535. Thanks [@poke30744](https://github.com/poke30744)!
- Fixed a GDI object leak in the context menu which would crash Explorer.
- Added a global GPO rule that applies for all utilities unless it's overridden. Thanks [@htcfreek](https://github.com/htcfreek)!
- Added GPO rules to control which PowerToys Run plugins should be enabled/disabled by policy. Thanks [@htcfreek](https://github.com/htcfreek)!
* All plugins have to provide its plugin ID as static property in its Main method.
### Find My Mouse
### Image Resizer
- Added new activation methods, including by hotkey. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
### Hosts File Editor
- Ignore the default ACME sample entries in the hosts file. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Improved save error handling and added better error messages. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Corrected a check for an error when signaling the application to start as administrator.
- Refactored the context menu. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed dialogs overlapping the title bar after the upgrade to Windows App SDK 1.4. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed wrong .bmp file association in the registry. Thanks [@meitinger](https://github.com/meitinger)!
### Keyboard Manager
- Distinguish between the regular minus key and the numpad minus key.
- Visually distinguish between the Numpad and regular period characters in the UI.
- This utility is now disabled by default on new installations, since it requires user configuration to affect keyboard behavior.
- Fixed a typo in the Numpad Subtract key in the editor.
### Mouse Without Borders
### Mouse Highlighter
- Fixed a crash when trying to restart the application.
- Removed the lower limit of fade delay and duration, to allow better signaling of doing a double click. Thanks [@fredso90](https://github.com/fredso90)!
### Mouse Jump
- The process now runs in the background, for a faster activation time. Thanks [@mikeclayton](https://github.com/mikeclayton)!
### Peek
- Using Peek on HTML files will show a white background by default, similar to a browser's default behavior.
- Fix a white flash on Dark theme when switching file and improved the development file preview detection and adjustments.
- Reported file sizes will now more closely match what's reported by File Explorer. Thanks [@Deepak-Sangle](https://github.com/Deepak-Sangle)!
- Added a previewer that hosts File Explorer previewers to support every file type that a machine is currently able to preview. Thanks [@dillydylann](https://github.com/dillydylann)!
- Fixed an issue causing the preview of the first file to be stuck loading. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed showing the previously previewed video file when invoking Peek with a new file. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Added the wrap and file formatting options to the Monaco previewer. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
### PowerRename
- Fixed a crash caused by big counter values on the new enumeration method.
- Save data from the last run in a different file to avoid conflicting with changing settings in the Settings application.
### PowerToys Run
- It's now possible to select which shell is used by the Shell plugin.
- A combobox option type was added to the plugin options.
- Fixed a bug in the Calculator plugin that was causing decimal numbers to be misinterpreted on locales where the dot (`.`) character isn't used as a decimal or digit separator.
- Improved the Program plugin stability when it fails to load a program's thumbnail at startup.
- The use of Pinyin for querying some plugins can now be turned on in Settings. Thanks [@ChaseKnowlden](https://github.com/ChaseKnowlden)!
- Refactored option types for plugin and added number, string and composite types to be used in the future. Thanks [@htcfreek](https://github.com/htcfreek)!
- Fixed the entry for searching for Windows updates in the Settings plugin. Thanks [@htcfreek](https://github.com/htcfreek)!
- Fixed a case where the query wasn't being cleared after invoking a result action through the keyboard. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Improved the shell selection option for Windows Terminal in the Shell plugin and improved the backend code for adding combo box options to plugins. Thanks [@htcfreek](https://github.com/htcfreek)!
* The implementation of the combo box items has changed amd isn't backward compatible. (Old plugins won't crash, but the combo box setting isn't shown in settings ui anymore.)
- Added Unix time in milliseconds, fixed negative unix time input and improved error messages in the TimeDate plugin. Thanks [@htcfreek](https://github.com/htcfreek)!
- The PowerToys plugin allows calling the new Environment Variables utility. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Refactored and added support to VSCodium Stable, VSCodium Insider and Remote Tunnels workspaces. Thanks [@eternalphane](https://github.com/eternalphane)!
### Quick Accent
- The "All languages" character set is now calculated by programmatically querying the characters for every available language. Thanks [@dannysummerlin](https://github.com/dannysummerlin)!
- Added é to the Norwegian and Swedish languages. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
- Added a runtime cache to the "All languages" character set, to only calculate accents once per key.
- Fixed characters that were removed from "All languages" because they were not in any single language. (This was a hotfix for 0.74)
- Added Asturian characters to the Spanish character set. Thanks [@blakestack](https://github.com/blakestack)!
- Added Greek characters with tonos. Thanks [@PesBandi](https://github.com/PesBandi)!
### Registry Preview
- Fixed focusing issues at startup.
- Improved the data visualization to show data in a similar way to the Windows Registry Editor. Thanks [@dillydylann](https://github.com/dillydylann)!
- Fixed a parsing error that crashed the Application. (This was a hotfix for 0.74)
- Fixed opening file names with non-ASCII characters. Thanks [@randyrants](https://github.com/randyrants)!
- Fixed wrong parsing when the file contained an assignment with spaces around the equals sign. Thanks [@randyrants](https://github.com/randyrants)!
- Fixed key transversal issues when a key was a substring of a parent key. Thanks [@randyrants](https://github.com/randyrants)!
### Runner
- Fixed hanging when a bug report was generated from the flyout. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Fixed the update notification toast to show an Unicode arrow. Thanks [@TheJoeFin](https://github.com/TheJoeFin)!
### Settings
- Improved the way the OOBE window reacts to Windows theme change.
- Fixed an issue that made it impossible to change the "Switch between windows in the current zone" "Next window" shortcut for FancyZones.
- Fixed a crash when entering a duplicate name for a color in the Color Picker page and improved clean up when cancelling a color edit. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Added a new Dashboard home page, with quick access for enabling modules, short descriptions and activation methods. Thanks [@niels9001](https://github.com/niels9001) for the design and UI work that made this possible!
- Fixed a typo in the Hosts File Editor page. Thanks [@Deepak-Sangle](https://github.com/Deepak-Sangle)!
- Added a lock icon to the flyout listing of all modules when its enabled state is controlled by policy.
- The "All apps" list in the flyout will now list all apps even if their enabled state is controlled by policy.
### Text Extractor
### Video Conference Mute
- Text Extractor 2.0, with a new overlay, table mode and more Quality of Life improvements. Thanks [@TheJoeFin](https://github.com/TheJoeFin)!
- Added an option to allow for the toolbar to hide after some time passed. Thanks [@quyenvsp](https://github.com/quyenvsp)!
- Added an option to select to mute or unmute at startup. Thanks [@quyenvsp](https://github.com/quyenvsp)!
- Fixed an issue causing a cascade of mute/unmute triggers.
### Documentation
- SECURITY.md was updated from 0.0.2 to 0.0.9. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
- Improved the README and main development document for clarity and completeness. Thanks [@codeofdusk](https://github.com/codeofdusk) and [@aprilbbrockhoeft](https://github.com/aprilbbrockhoeft)!
- Updated the Group Policy documentation on learn.microsoft.com, removed the Group Policy documentation from the repository and linked to the published documentation on learn.microsoft.com instead.
### Development
- Fixed PowerToys Run DateTime plugin tests that were failing depending on locale, so that they can be run correctly on all dev machines.
- Fixed PowerToys Run System plugin tests that were failing for certain network interfaces, so that they can be run correctly on all dev machines. Thanks [@snickler](https://github.com/snickler)!
- Fixed a markdown bug on the GitHub /helped command.
- Switched build pipelines to a new agent pool. Thanks [@DHowett](https://github.com/DHowett)!
- New .cs files created in Visual Studio get the header added automatically. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Added project dependencies to the version project and headers to avoid building errors. Thanks [@johnterickson](https://github.com/johnterickson)!
- Enabled Control Flow Guard in the C++ projects. Thanks [@DHowett](https://github.com/DHowett)!
- Switched the release pipeline to the 1ES governed template. Thanks [@DHowett](https://github.com/DHowett)!
- Styled XAML files and added a XAML Style checker to the solution, with a CI action to check if code being contributed is compliant. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
- Suppressed redundant midl file warnings in PowerRename.
- Add unit tests to FancyZones Editor. Thanks [@garv5014](https://github.com/garv5014), [@andrewbengordon](https://github.com/andrewbengordon) and [@Cwighty](https://github.com/Cwighty)!
- Improved the Default Layouts internal structure in FancyZones Editor. Thanks [@garv5014](https://github.com/garv5014)!
- Fixed code issues to allow building in Visual Studio 17.8 Preview 4.
#### What is being planned for version 0.75
#### What is being planned for version 0.76
For [v0.75][github-next-release-work], we'll work on the items below:
For [v0.76][github-next-release-work], we'll work on the items below:
- Language selection
- .NET 8 upgrade
- Policy support for managing PowerToys Run plugins.
*Attention*: A breaking change is planned (for 0.75), in which each plugin has to declare its identifier programmatically so that it can be controlled through GPO. For third-party plugin developers, please check https://github.com/microsoft/PowerToys/pull/27468 for more details.
- New utility: Environment Variables Editor. Here's a Work in Progress preview:
![Environment Variables Editor WIP](https://github.com/microsoft/PowerToys/assets/26118718/f99532a8-5aae-481b-a662-19a95f4aa03d)
- New Settings homepage. Here's a Work in Progress preview:
![PowerToys Settings Dashboard WIP](https://github.com/microsoft/PowerToys/assets/26118718/938a5715-0a9b-4fe9-9e15-adfec92da694)
- Allowing Keyboard Manager to output arbitrary Unicode sequences
- Automated UI testing through WinAppDriver
- Modernize and refresh the UX of PowerToys based on WPF. Here's Work in Progress previews for the modules "PowerToys Run" and "Color Picker":
![PowerToys Run UI refresh WIP](https://github.com/microsoft/PowerToys/assets/9866362/16903bcb-c18e-49fb-93ca-738b81957055)

View File

@ -28,7 +28,7 @@
Type="string" />
<!-- Registry Keys for the context menu handler for each of the following image formats: bmp, dib, gif, jfif, jpe, jpeg, jpg, jxr, png, rle, tif, tiff, wdp -->
<RegistryValue Root="$(var.RegistryScope)"
Key="SOFTWARE\Classes\SOFTWARE\Classes\SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
Key="SOFTWARE\Classes\SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="$(var.RegistryScope)"

View File

@ -38,5 +38,67 @@ namespace ManagedCommon
[DllImport("user32.dll")]
internal static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
[DllImport("user32.dll")]
internal static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize);
[StructLayout(LayoutKind.Sequential)]
public struct INPUT
{
internal INPUTTYPE type;
internal InputUnion data;
internal static int Size
{
get { return Marshal.SizeOf(typeof(INPUT)); }
}
}
[StructLayout(LayoutKind.Explicit)]
internal struct InputUnion
{
[FieldOffset(0)]
internal MOUSEINPUT mi;
[FieldOffset(0)]
internal KEYBDINPUT ki;
[FieldOffset(0)]
internal HARDWAREINPUT hi;
}
[StructLayout(LayoutKind.Sequential)]
internal struct MOUSEINPUT
{
internal int dx;
internal int dy;
internal int mouseData;
internal uint dwFlags;
internal uint time;
internal UIntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential)]
internal struct KEYBDINPUT
{
internal short wVk;
internal short wScan;
internal uint dwFlags;
internal int time;
internal UIntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential)]
internal struct HARDWAREINPUT
{
internal int uMsg;
internal short wParamL;
internal short wParamH;
}
internal enum INPUTTYPE : uint
{
INPUT_MOUSE = 0,
INPUT_KEYBOARD = 1,
INPUT_HARDWARE = 2,
}
}
}

View File

@ -10,8 +10,16 @@ namespace ManagedCommon
{
public static void BringToForeground(IntPtr handle)
{
NativeMethods.INPUT input = new NativeMethods.INPUT { type = NativeMethods.INPUTTYPE.INPUT_MOUSE, data = { } };
NativeMethods.INPUT[] inputs = new NativeMethods.INPUT[] { input };
_ = NativeMethods.SendInput(1, inputs, NativeMethods.INPUT.Size);
NativeMethods.SetForegroundWindow(handle);
var fgHandle = NativeMethods.GetForegroundWindow();
if (fgHandle != handle)
{
var threadId1 = NativeMethods.GetWindowThreadProcessId(handle, System.IntPtr.Zero);
var threadId2 = NativeMethods.GetWindowThreadProcessId(fgHandle, System.IntPtr.Zero);
@ -28,3 +36,4 @@ namespace ManagedCommon
}
}
}
}

View File

@ -145,7 +145,7 @@ void LayoutMap::LayoutMapImpl::UpdateLayout()
keyboardLayoutMap[VK_RETURN | numpadOriginBit] = L"Enter (Numpad)";
keyboardLayoutMap[VK_DIVIDE | numpadOriginBit] = L"/ (Numpad)";
keyboardLayoutMap[VK_SUBTRACT] = L"- (Substract)";
keyboardLayoutMap[VK_SUBTRACT] = L"- (Subtract)";
keyboardLayoutMap[VK_SELECT] = L"Select";
keyboardLayoutMap[VK_PRINT] = L"Print";
keyboardLayoutMap[VK_EXECUTE] = L"Execute";

View File

@ -70,4 +70,40 @@ namespace json
{
return value; // identity function overload for convenience
}
template<typename T, typename D = std::optional<T>>
requires std::constructible_from<std::optional<T>, D>
void get(const json::JsonObject& o, const wchar_t* name, T& destination, D default_value = std::nullopt)
{
try
{
if constexpr (std::is_same_v<T, bool>)
{
destination = o.GetNamedBoolean(name);
}
else if constexpr (std::is_arithmetic_v<T>)
{
destination = static_cast<T>(o.GetNamedNumber(name));
}
else if constexpr (std::is_same_v<T, std::wstring>)
{
destination = o.GetNamedString(name);
}
else if constexpr (std::is_same_v<T, json::JsonObject>)
{
destination = o.GetNamedObject(name);
}
else
{
static_assert(std::bool_constant<std::is_same_v<T, T&>>::value, "Unsupported type");
}
}
catch (...)
{
std::optional<T> maybe_default{ std::move(default_value) };
if (maybe_default.has_value())
destination = std::move(*maybe_default);
}
}
}

View File

@ -24,10 +24,24 @@
<DataTemplate x:Key="VariableTemplate" x:DataType="models:Variable">
<controls:SettingsCard
CommandParameter="{x:Bind (models:Variable)}"
Header="{x:Bind Name, Mode=TwoWay}"
IsActionIconVisible="False"
IsClickEnabled="False"
Style="{StaticResource DefaultSettingsExpanderItemStyle}">
<controls:SettingsCard.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Bind Name, Mode=TwoWay}" />
<FontIcon
Margin="6,0,6,0"
FontSize="16"
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
Glyph="&#xE930;"
Visibility="{x:Bind IsAppliedFromProfile, Converter={StaticResource BoolToVisibilityConverter}}">
<ToolTipService.ToolTip>
<TextBlock x:Uid="VariableIsAppliedByActiveProfileTooltip" TextWrapping="Wrap" />
</ToolTipService.ToolTip>
</FontIcon>
</StackPanel>
</controls:SettingsCard.Header>
<controls:SettingsCard.Description>
<StackPanel HorizontalAlignment="Left">
<ItemsControl
@ -52,8 +66,10 @@
Visibility="{x:Bind ShowAsList, Converter={StaticResource BoolToInvertedVisibilityConverter}}" />
</StackPanel>
</controls:SettingsCard.Description>
<Button Content="{ui:FontIcon Glyph=&#xE712;}" Style="{StaticResource SubtleButtonStyle}">
<Button
Content="{ui:FontIcon Glyph=&#xE712;}"
IsEnabled="{x:Bind IsEditable}"
Style="{StaticResource SubtleButtonStyle}">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem
@ -448,6 +464,7 @@
Text="{Binding Values, Mode=TwoWay}"
TextChanged="EditVariableDialogValueTxtBox_TextChanged"
TextWrapping="Wrap" />
<MenuFlyoutSeparator Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}" />
<ListView
x:Name="EditVariableValuesList"
Margin="-16,-8,0,12"

View File

@ -21,25 +21,25 @@ namespace EnvironmentVariables.Helpers
internal static Variable GetExisting(string variableName)
{
var userVariables = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.User);
DefaultVariablesSet userSet = new DefaultVariablesSet(Guid.NewGuid(), "tmpUser", VariablesSetType.User);
GetVariables(EnvironmentVariableTarget.User, userSet);
foreach (DictionaryEntry variable in userVariables)
foreach (var variable in userSet.Variables)
{
var key = variable.Key as string;
if (key.Equals(variableName, StringComparison.OrdinalIgnoreCase))
if (variable.Name.Equals(variableName, StringComparison.OrdinalIgnoreCase))
{
return new Variable(key, userVariables[key] as string, VariablesSetType.User);
return new Variable(variable.Name, variable.Values, VariablesSetType.User);
}
}
var systemVariables = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Machine);
DefaultVariablesSet systemSet = new DefaultVariablesSet(Guid.NewGuid(), "tmpSystem", VariablesSetType.System);
GetVariables(EnvironmentVariableTarget.Machine, systemSet);
foreach (DictionaryEntry variable in systemVariables)
foreach (var variable in systemSet.Variables)
{
var key = variable.Key as string;
if (key.Equals(variableName, StringComparison.OrdinalIgnoreCase))
if (variable.Name.Equals(variableName, StringComparison.OrdinalIgnoreCase))
{
return new Variable(key, systemVariables[key] as string, VariablesSetType.System);
return new Variable(variable.Name, variable.Values, VariablesSetType.System);
}
}
@ -65,6 +65,9 @@ namespace EnvironmentVariables.Helpers
return baseKey.OpenSubKey(keyName, writable: writable);
}
// Code taken from https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs
// Set variables directly to registry instead of using Environment API - Environment.SetEnvironmentVariable() has 1 second timeout for SendNotifyMessage(WM_SETTINGSCHANGED).
// When applying profile, this would take num_of_variables * 1s to propagate the changes. We do manually SendNotifyMessage with no timeout where needed.
private static void SetEnvironmentVariableFromRegistryWithoutNotify(string variable, string value, bool fromMachine)
{
const int MaxUserEnvVariableLength = 255; // User-wide env vars stored in the registry have names limited to 255 chars
@ -84,7 +87,15 @@ namespace EnvironmentVariables.Helpers
}
else
{
environmentKey.SetValue(variable, value);
// If a variable contains %, we save it as a REG_EXPAND_SZ, which is the same behavior as the Windows default environment variables editor.
if (value.Contains('%'))
{
environmentKey.SetValue(variable, value, RegistryValueKind.ExpandString);
}
else
{
environmentKey.SetValue(variable, value, RegistryValueKind.String);
}
}
}
}
@ -102,23 +113,32 @@ namespace EnvironmentVariables.Helpers
}
}
// Code taken from https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs
// Reading variables from registry instead of using Environment API, because Environment API expands variables by default.
internal static void GetVariables(EnvironmentVariableTarget target, VariablesSet set)
{
var variables = Environment.GetEnvironmentVariables(target);
var sortedList = new SortedList<string, Variable>();
foreach (DictionaryEntry variable in variables)
{
string key = variable.Key as string;
string value = variable.Value as string;
bool fromMachine = target == EnvironmentVariableTarget.Machine ? true : false;
if (string.IsNullOrEmpty(key))
using (RegistryKey environmentKey = OpenEnvironmentKeyIfExists(fromMachine, writable: false))
{
continue;
if (environmentKey != null)
{
foreach (string name in environmentKey.GetValueNames())
{
string value = environmentKey.GetValue(name, string.Empty, RegistryValueOptions.DoNotExpandEnvironmentNames).ToString();
try
{
Variable entry = new Variable(name, value, set.Type);
sortedList.Add(name, entry);
}
catch (ArgumentException)
{
// Throw and catch intentionally to provide non-fatal notification about corrupted environment block
}
}
}
Variable entry = new Variable(key, value, set.Type);
sortedList.Add(key, entry);
}
set.Variables = new System.Collections.ObjectModel.ObservableCollection<Variable>(sortedList.Values);

View File

@ -28,12 +28,17 @@ namespace EnvironmentVariables.Models
[ObservableProperty]
private bool _applyToSystem;
[JsonIgnore]
[property: JsonIgnore]
[ObservableProperty]
private bool _isAppliedFromProfile; // Used to mark that a variable in a default set is applied by a profile. Used to disable editing / mark it in the UI.
[JsonIgnore]
public bool IsEditable
{
get
{
return ParentType != VariablesSetType.System || App.GetService<IElevationHelper>().IsElevated;
return (ParentType != VariablesSetType.System || App.GetService<IElevationHelper>().IsElevated) && !IsAppliedFromProfile;
}
}

View File

@ -170,10 +170,12 @@
<value>Add variable</value>
</data>
<data name="AddNewVariableName.Header" xml:space="preserve">
<value>Variable name</value>
<value>Name</value>
<comment>Name as in Environment variable name</comment>
</data>
<data name="AddNewVariableValue.Header" xml:space="preserve">
<value>Variable value</value>
<value>Value</value>
<comment>Value as in Environment variable value</comment>
</data>
<data name="ExistingVariableSegmentedButton.Content" xml:space="preserve">
<value>Existing</value>
@ -278,4 +280,7 @@
<data name="StateProfileNotApplicableMsg" xml:space="preserve">
<value>Variables or backup variables are invalid.</value>
</data>
<data name="VariableIsAppliedByActiveProfileTooltip.Text" xml:space="preserve">
<value>This variable is written by the active profile</value>
</data>
</root>

View File

@ -67,6 +67,16 @@ namespace EnvironmentVariables.ViewModels
foreach (var variable in UserDefaultSet.Variables)
{
DefaultVariables.Variables.Add(variable);
if (AppliedProfile != null)
{
if (AppliedProfile.Variables.Where(
x => (x.Name.Equals(variable.Name, StringComparison.OrdinalIgnoreCase) && x.Values.Equals(variable.Values, StringComparison.OrdinalIgnoreCase))
|| variable.Name.Equals(EnvironmentVariablesHelper.GetBackupVariableName(x, AppliedProfile.Name), StringComparison.OrdinalIgnoreCase)).Any())
{
// If it's a user variable that's also in the profile or is a backup variable, mark it as applied from profile.
variable.IsAppliedFromProfile = true;
}
}
}
foreach (var variable in SystemDefaultSet.Variables)
@ -132,10 +142,13 @@ namespace EnvironmentVariables.ViewModels
var variables = new List<Variable>();
if (AppliedProfile != null)
{
variables = variables.Concat(AppliedProfile.Variables.OrderBy(x => x.Name)).ToList();
variables = variables.Concat(AppliedProfile.Variables.Select(x => new Variable(x.Name, Environment.ExpandEnvironmentVariables(x.Values), VariablesSetType.Profile)).OrderBy(x => x.Name)).ToList();
}
variables = variables.Concat(UserDefaultSet.Variables.OrderBy(x => x.Name)).Concat(SystemDefaultSet.Variables.OrderBy(x => x.Name)).ToList();
// Variables are expanded to be shown in the applied variables section, so the user sees their actual values.
variables = variables.Concat(UserDefaultSet.Variables.Select(x => new Variable(x.Name, Environment.ExpandEnvironmentVariables(x.Values), VariablesSetType.User)).OrderBy(x => x.Name))
.Concat(SystemDefaultSet.Variables.Select(x => new Variable(x.Name, Environment.ExpandEnvironmentVariables(x.Values), VariablesSetType.System)).OrderBy(x => x.Name))
.ToList();
// Handle PATH variable - add USER value to the end of the SYSTEM value
var profilePath = variables.Where(x => x.Name.Equals("PATH", StringComparison.OrdinalIgnoreCase) && x.ParentType == VariablesSetType.Profile).FirstOrDefault();

View File

@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using Hosts.Helpers;
using ManagedCommon;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using WinUIEx;
@ -25,7 +26,7 @@ namespace Hosts
AppTitleTextBlock.Text = title;
var handle = this.GetWindowHandle();
ManagedCommon.WindowHelpers.BringToForeground(handle);
WindowHelpers.BringToForeground(handle);
Activated += MainWindow_Activated;
}

View File

@ -212,6 +212,15 @@ void Highlighter::StartDrawingPointFading(MouseButton button)
auto animation = m_compositor.CreateColorKeyFrameAnimation();
animation.InsertKeyFrame(1, winrt::Windows::UI::ColorHelper::FromArgb(0, brushColor.R, brushColor.G, brushColor.B));
using timeSpan = std::chrono::duration<int, std::ratio<1, 1000>>;
// HACK: If user sets these durations to 0, the fade won't work. Setting them to 1ms instead to avoid this.
if (m_fadeDuration_ms == 0)
{
m_fadeDuration_ms = 1;
}
if (m_fadeDelay_ms == 0)
{
m_fadeDelay_ms = 1;
}
std::chrono::milliseconds duration(m_fadeDuration_ms);
std::chrono::milliseconds delay(m_fadeDelay_ms);
animation.Duration(timeSpan(duration));

View File

@ -157,7 +157,7 @@ private:
void UpdateHotkey(int hotkeyId, const PowerToysSettings::HotkeyObject& hotkeyObject, bool enable) noexcept;
bool MoveToAppLastZone(HWND window, HMONITOR monitor) noexcept;
bool MoveToAppLastZone(HWND window, HMONITOR monitor, GUID currentVirtualDesktop) noexcept;
void RefreshLayouts() noexcept;
bool ShouldProcessSnapHotkey(DWORD vkCode) noexcept;
@ -257,7 +257,6 @@ FancyZones::Run() noexcept
}
});
VirtualDesktop::instance().UpdateVirtualDesktopId();
SyncVirtualDesktops();
// id format of applied-layouts and app-zone-history was changed in 0.60
@ -332,7 +331,7 @@ void FancyZones::MoveSizeEnd()
}
}
bool FancyZones::MoveToAppLastZone(HWND window, HMONITOR monitor) noexcept
bool FancyZones::MoveToAppLastZone(HWND window, HMONITOR monitor, GUID currentVirtualDesktop) noexcept
{
const auto& workAreas = m_workAreaConfiguration.GetAllWorkAreas();
WorkArea* workArea{ nullptr };
@ -343,7 +342,7 @@ bool FancyZones::MoveToAppLastZone(HWND window, HMONITOR monitor) noexcept
if (workAreas.contains(monitor))
{
workArea = workAreas.at(monitor).get();
if (workArea)
if (workArea && workArea->UniqueId().virtualDesktopId == currentVirtualDesktop)
{
indexes = AppZoneHistory::instance().GetAppLastZoneIndexSet(window, workArea->UniqueId(), workArea->GetLayoutId());
}
@ -357,7 +356,7 @@ bool FancyZones::MoveToAppLastZone(HWND window, HMONITOR monitor) noexcept
{
for (const auto& [_, secondaryWorkArea] : workAreas)
{
if (secondaryWorkArea)
if (secondaryWorkArea && secondaryWorkArea->UniqueId().virtualDesktopId == currentVirtualDesktop)
{
indexes = AppZoneHistory::instance().GetAppLastZoneIndexSet(window, secondaryWorkArea->UniqueId(), secondaryWorkArea->GetLayoutId());
workArea = secondaryWorkArea.get();
@ -395,6 +394,15 @@ void FancyZones::WindowCreated(HWND window) noexcept
return;
}
// Hotfix
// Avoid automatically moving popup windows, as they can be just popup menus.
bool isPopup = FancyZonesWindowUtils::IsPopupWindow(window);
bool hasThickFrame = FancyZonesWindowUtils::HasThickFrame(window);
if (isPopup && !hasThickFrame)
{
return;
}
// Avoid already stamped (zoned) windows
const bool isZoned = !FancyZonesWindowProperties::RetrieveZoneIndexProperty(window).empty();
if (isZoned)
@ -412,27 +420,28 @@ void FancyZones::WindowCreated(HWND window) noexcept
}
bool windowMovedToZone = false;
auto currentVirtualDesktop = VirtualDesktop::instance().GetCurrentVirtualDesktopIdFromRegistry();
if (moveToAppLastZone)
{
if (FancyZonesSettings::settings().spanZonesAcrossMonitors)
{
windowMovedToZone = MoveToAppLastZone(window, nullptr);
windowMovedToZone = MoveToAppLastZone(window, nullptr, currentVirtualDesktop);
}
else
{
// Search application history on currently active monitor.
windowMovedToZone = MoveToAppLastZone(window, active);
windowMovedToZone = MoveToAppLastZone(window, active, currentVirtualDesktop);
if (!windowMovedToZone && primary != active)
{
// Search application history on primary monitor.
windowMovedToZone = MoveToAppLastZone(window, primary);
windowMovedToZone = MoveToAppLastZone(window, primary, currentVirtualDesktop);
}
if (!windowMovedToZone)
{
// Search application history on remaining monitors.
windowMovedToZone = MoveToAppLastZone(window, nullptr);
windowMovedToZone = MoveToAppLastZone(window, nullptr, currentVirtualDesktop);
}
}
}
@ -641,12 +650,10 @@ LRESULT FancyZones::WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lpa
}
else if (message == WM_PRIV_INIT)
{
VirtualDesktop::instance().UpdateVirtualDesktopId();
OnDisplayChange(DisplayChangeType::Initialization);
}
else if (message == WM_PRIV_VD_SWITCH)
{
VirtualDesktop::instance().UpdateVirtualDesktopId();
OnDisplayChange(DisplayChangeType::VirtualDesktop);
}
else if (message == WM_PRIV_EDITOR)
@ -745,10 +752,10 @@ void FancyZones::OnDisplayChange(DisplayChangeType changeType) noexcept
bool FancyZones::AddWorkArea(HMONITOR monitor, const FancyZonesDataTypes::WorkAreaId& id) noexcept
{
wil::unique_cotaskmem_string virtualDesktopIdStr;
if (!SUCCEEDED(StringFromCLSID(VirtualDesktop::instance().GetCurrentVirtualDesktopId(), &virtualDesktopIdStr)))
auto virtualDesktopIdStr = FancyZonesUtils::GuidToString(id.virtualDesktopId);
if (virtualDesktopIdStr)
{
Logger::debug(L"Add new work area on virtual desktop {}", virtualDesktopIdStr.get());
Logger::debug(L"Add new work area on virtual desktop {}", virtualDesktopIdStr.value());
}
FancyZonesUtils::Rect rect{};
@ -794,11 +801,12 @@ void FancyZones::UpdateWorkAreas(bool updateWindowPositions) noexcept
Logger::debug(L"Update work areas, update windows positions: {}", updateWindowPositions);
m_workAreaConfiguration.Clear();
auto currentVirtualDesktop = VirtualDesktop::instance().GetCurrentVirtualDesktopIdFromRegistry();
if (FancyZonesSettings::settings().spanZonesAcrossMonitors)
{
FancyZonesDataTypes::WorkAreaId workAreaId;
workAreaId.virtualDesktopId = VirtualDesktop::instance().GetCurrentVirtualDesktopId();
workAreaId.virtualDesktopId = currentVirtualDesktop;
workAreaId.monitorId = { .deviceId = { .id = ZonedWindowProperties::MultiMonitorName, .instanceId = ZonedWindowProperties::MultiMonitorInstance } };
AddWorkArea(nullptr, workAreaId);
@ -809,7 +817,7 @@ void FancyZones::UpdateWorkAreas(bool updateWindowPositions) noexcept
for (const auto& monitor : monitors)
{
FancyZonesDataTypes::WorkAreaId workAreaId;
workAreaId.virtualDesktopId = VirtualDesktop::instance().GetCurrentVirtualDesktopId();
workAreaId.virtualDesktopId = currentVirtualDesktop;
workAreaId.monitorId = monitor;
AddWorkArea(monitor.monitor, workAreaId);
@ -906,7 +914,7 @@ void FancyZones::SyncVirtualDesktops() noexcept
// that case (00000000-0000-0000-0000-000000000000).
auto lastUsed = LastUsedVirtualDesktop::instance().GetId();
auto current = VirtualDesktop::instance().GetCurrentVirtualDesktopId();
auto current = VirtualDesktop::instance().GetCurrentVirtualDesktopIdFromRegistry();
auto guids = VirtualDesktop::instance().GetVirtualDesktopIdsFromRegistry();
if (current != lastUsed)

View File

@ -277,34 +277,9 @@ void AppZoneHistory::LoadData()
}
void AppZoneHistory::SaveData()
{
bool dirtyFlag = false;
std::unordered_map<std::wstring, std::vector<FancyZonesDataTypes::AppZoneHistoryData>> updatedHistory;
for (const auto& [path, dataVector] : m_history)
{
auto updatedVector = dataVector;
for (auto& data : updatedVector)
{
if (!VirtualDesktop::instance().IsVirtualDesktopIdSavedInRegistry(data.workAreaId.virtualDesktopId))
{
data.workAreaId.virtualDesktopId = GUID_NULL;
dirtyFlag = true;
}
}
updatedHistory.insert(std::make_pair(path, updatedVector));
}
if (dirtyFlag)
{
json::to_file(AppZoneHistoryFileName(), JsonUtils::SerializeJson(updatedHistory));
}
else
{
json::to_file(AppZoneHistoryFileName(), JsonUtils::SerializeJson(m_history));
}
}
void AppZoneHistory::AdjustWorkAreaIds(const std::vector<FancyZonesDataTypes::MonitorId>& ids)
{

View File

@ -27,9 +27,8 @@ bool FancyZonesWindowProcessing::IsProcessable(HWND window) noexcept
// popup could be the window we don't want to snap: start menu, notification popup, tray window, etc.
// also, popup could be the windows we want to snap disregarding the "allowSnapPopupWindows" setting, e.g. Telegram
bool isPopup = FancyZonesWindowUtils::IsPopupWindow(window);
bool hasThickFrame = FancyZonesWindowUtils::HasThickFrame(window);
if (isPopup && (!hasThickFrame || !FancyZonesSettings::settings().allowSnapPopupWindows))
bool isPopup = FancyZonesWindowUtils::IsPopupWindow(window) && !FancyZonesWindowUtils::HasThickFrameAndMinimizeMaximizeButtons(window);
if (isPopup && !FancyZonesSettings::settings().allowSnapPopupWindows)
{
return false;
}

View File

@ -96,14 +96,14 @@ VirtualDesktop& VirtualDesktop::instance()
return self;
}
std::optional<GUID> VirtualDesktop::GetCurrentVirtualDesktopIdFromRegistry() const
GUID VirtualDesktop::GetCurrentVirtualDesktopIdFromRegistry() const
{
// On newer Windows builds, the current virtual desktop is persisted to
// a totally different reg key. Look there first.
std::optional<GUID> desktopId = NewGetCurrentDesktopId();
if (desktopId.has_value())
{
return desktopId;
return desktopId.value();
}
// Explorer persists current virtual desktop identifier to registry on a per session basis, but only
@ -112,7 +112,7 @@ std::optional<GUID> VirtualDesktop::GetCurrentVirtualDesktopIdFromRegistry() con
desktopId = GetDesktopIdFromCurrentSession();
if (desktopId.has_value())
{
return desktopId;
return desktopId.value();
}
// Fallback scenario is to get array of virtual desktops stored in registry, but not kept per session.
@ -128,7 +128,7 @@ std::optional<GUID> VirtualDesktop::GetCurrentVirtualDesktopIdFromRegistry() con
}
}
return std::nullopt;
return GUID_NULL;
}
std::optional<std::vector<GUID>> VirtualDesktop::GetVirtualDesktopIdsFromRegistry(HKEY hKey) const
@ -169,25 +169,6 @@ std::optional<std::vector<GUID>> VirtualDesktop::GetVirtualDesktopIdsFromRegistr
return GetVirtualDesktopIdsFromRegistry(GetVirtualDesktopsRegKey());
}
bool VirtualDesktop::IsVirtualDesktopIdSavedInRegistry(GUID id) const
{
auto ids = GetVirtualDesktopIdsFromRegistry();
if (!ids.has_value())
{
return false;
}
for (const auto& regId : *ids)
{
if (regId == id)
{
return true;
}
}
return false;
}
bool VirtualDesktop::IsWindowOnCurrentDesktop(HWND window) const
{
BOOL isWindowOnCurrentDesktop = false;
@ -199,47 +180,6 @@ bool VirtualDesktop::IsWindowOnCurrentDesktop(HWND window) const
return isWindowOnCurrentDesktop;
}
std::optional<GUID> VirtualDesktop::GetDesktopId(HWND window) const
{
GUID id;
BOOL isWindowOnCurrentDesktop = false;
if (m_vdManager && m_vdManager->IsWindowOnCurrentVirtualDesktop(window, &isWindowOnCurrentDesktop) == S_OK && isWindowOnCurrentDesktop)
{
// Filter windows such as Windows Start Menu, Task Switcher, etc.
if (m_vdManager->GetWindowDesktopId(window, &id) == S_OK)
{
return id;
}
}
return std::nullopt;
}
std::vector<std::pair<HWND, GUID>> VirtualDesktop::GetWindowsRelatedToDesktops() const
{
using result_t = std::vector<HWND>;
result_t windows;
auto callback = [](HWND window, LPARAM data) -> BOOL {
result_t& result = *reinterpret_cast<result_t*>(data);
result.push_back(window);
return TRUE;
};
EnumWindows(callback, reinterpret_cast<LPARAM>(&windows));
std::vector<std::pair<HWND, GUID>> result;
for (auto window : windows)
{
auto desktop = GetDesktopId(window);
if (desktop.has_value())
{
result.push_back({ window, *desktop });
}
}
return result;
}
std::vector<HWND> VirtualDesktop::GetWindowsFromCurrentDesktop() const
{
using result_t = std::vector<HWND>;
@ -264,48 +204,3 @@ std::vector<HWND> VirtualDesktop::GetWindowsFromCurrentDesktop() const
return result;
}
GUID VirtualDesktop::GetCurrentVirtualDesktopId() const noexcept
{
return m_currentVirtualDesktopId;
}
void VirtualDesktop::UpdateVirtualDesktopId() noexcept
{
auto currentVirtualDesktopId = GetCurrentVirtualDesktopIdFromRegistry();
if (currentVirtualDesktopId.has_value())
{
m_currentVirtualDesktopId = currentVirtualDesktopId.value();
}
else
{
m_currentVirtualDesktopId = GUID_NULL;
}
Trace::VirtualDesktopChanged();
}
std::optional<GUID> VirtualDesktop::GetDesktopIdByTopLevelWindows() const
{
using result_t = std::vector<HWND>;
result_t windows;
auto callback = [](HWND window, LPARAM data) -> BOOL {
result_t& result = *reinterpret_cast<result_t*>(data);
result.push_back(window);
return TRUE;
};
EnumWindows(callback, reinterpret_cast<LPARAM>(&windows));
for (const auto window : windows)
{
std::optional<GUID> id = GetDesktopId(window);
if (id.has_value())
{
// Otherwise keep checking other windows
return *id;
}
}
return std::nullopt;
}

View File

@ -5,21 +5,13 @@ class VirtualDesktop
public:
static VirtualDesktop& instance();
// saved values
GUID GetCurrentVirtualDesktopId() const noexcept;
void UpdateVirtualDesktopId() noexcept;
// IVirtualDesktopManager
bool IsWindowOnCurrentDesktop(HWND window) const;
std::optional<GUID> GetDesktopId(HWND window) const;
std::optional<GUID> GetDesktopIdByTopLevelWindows() const;
std::vector<std::pair<HWND, GUID>> GetWindowsRelatedToDesktops() const;
std::vector<HWND> GetWindowsFromCurrentDesktop() const;
// registry
std::optional<GUID> GetCurrentVirtualDesktopIdFromRegistry() const;
GUID GetCurrentVirtualDesktopIdFromRegistry() const;
std::optional<std::vector<GUID>> GetVirtualDesktopIdsFromRegistry() const;
bool IsVirtualDesktopIdSavedInRegistry(GUID id) const;
private:
VirtualDesktop();
@ -27,7 +19,5 @@ private:
IVirtualDesktopManager* m_vdManager{nullptr};
GUID m_currentVirtualDesktopId{};
std::optional<std::vector<GUID>> GetVirtualDesktopIdsFromRegistry(HKEY hKey) const;
};

View File

@ -10,6 +10,7 @@ using ImageResizer.Properties;
using ImageResizer.Utilities;
using ImageResizer.ViewModels;
using ImageResizer.Views;
using ManagedCommon;
namespace ImageResizer
{
@ -41,15 +42,7 @@ namespace ImageResizer
mainWindow.Show();
// Temporary workaround for issue #1273
BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle);
}
private static void BecomeForegroundWindow(IntPtr hWnd)
{
NativeMethods.INPUT input = new NativeMethods.INPUT { type = NativeMethods.INPUTTYPE.INPUT_MOUSE, data = { } };
NativeMethods.INPUT[] inputs = new NativeMethods.INPUT[] { input };
_ = NativeMethods.SendInput(1, inputs, NativeMethods.INPUT.Size);
NativeMethods.SetForegroundWindow(hWnd);
WindowHelpers.BringToForeground(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle);
}
public void Dispose()

View File

@ -15,69 +15,7 @@ namespace ImageResizer.Utilities
[DllImport("user32.dll")]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
internal static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize);
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool SetProcessDPIAware();
[StructLayout(LayoutKind.Sequential)]
public struct INPUT
{
internal INPUTTYPE type;
internal InputUnion data;
internal static int Size
{
get { return Marshal.SizeOf(typeof(INPUT)); }
}
}
[StructLayout(LayoutKind.Explicit)]
internal struct InputUnion
{
[FieldOffset(0)]
internal MOUSEINPUT mi;
[FieldOffset(0)]
internal KEYBDINPUT ki;
[FieldOffset(0)]
internal HARDWAREINPUT hi;
}
[StructLayout(LayoutKind.Sequential)]
internal struct MOUSEINPUT
{
internal int dx;
internal int dy;
internal int mouseData;
internal uint dwFlags;
internal uint time;
internal UIntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential)]
internal struct KEYBDINPUT
{
internal short wVk;
internal short wScan;
internal uint dwFlags;
internal int time;
internal UIntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential)]
internal struct HARDWAREINPUT
{
internal int uMsg;
internal short wParamL;
internal short wParamH;
}
internal enum INPUTTYPE : uint
{
INPUT_MOUSE = 0,
INPUT_KEYBOARD = 1,
INPUT_HARDWARE = 2,
}
}
}

View File

@ -74,7 +74,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper
if (Directory.Exists(path))
{
var files = Directory.GetFiles(path)
.Where(x => (x.Contains("code", StringComparison.OrdinalIgnoreCase) || x.Contains("VSCodium", StringComparison.OrdinalIgnoreCase))
.Where(x => (x.Contains("code", StringComparison.OrdinalIgnoreCase) || x.Contains("codium", StringComparison.OrdinalIgnoreCase))
&& !x.EndsWith(".cmd", StringComparison.OrdinalIgnoreCase)).ToArray();
var iconPath = Path.GetDirectoryName(path);
@ -104,10 +104,15 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper
version = "Code - Exploration";
instance.VSCodeVersion = VSCodeVersion.Exploration;
}
else if (file.EndsWith("VSCodium", StringComparison.OrdinalIgnoreCase))
else if (file.EndsWith("codium", StringComparison.OrdinalIgnoreCase))
{
version = "VSCodium";
instance.VSCodeVersion = VSCodeVersion.Stable; // ?
instance.VSCodeVersion = VSCodeVersion.Stable;
}
else if (file.EndsWith("codium-insiders", StringComparison.OrdinalIgnoreCase))
{
version = "VSCodium - Insiders";
instance.VSCodeVersion = VSCodeVersion.Insiders;
}
if (version != string.Empty)

View File

@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
public class ParseVSCodeAuthority
{
private static readonly Dictionary<string, WorkspaceEnvironment> EnvironmentTypes = new()
{
{ string.Empty, WorkspaceEnvironment.Local },
{ "ssh-remote", WorkspaceEnvironment.RemoteSSH },
{ "wsl", WorkspaceEnvironment.RemoteWSL },
{ "vsonline", WorkspaceEnvironment.Codespaces },
{ "dev-container", WorkspaceEnvironment.DevContainer },
{ "tunnel", WorkspaceEnvironment.RemoteTunnel },
};
private static string GetRemoteName(string authority)
{
if (authority is null)
{
return null;
}
var pos = authority.IndexOf('+');
if (pos < 0)
{
return authority;
}
return authority[..pos];
}
public static (WorkspaceEnvironment? WorkspaceEnvironment, string MachineName) GetWorkspaceEnvironment(string authority)
{
var remoteName = GetRemoteName(authority);
var machineName = remoteName.Length < authority.Length ? authority[(remoteName.Length + 1)..] : null;
return EnvironmentTypes.TryGetValue(remoteName, out WorkspaceEnvironment workspace) ?
(workspace, machineName) :
(null, null);
}
}
}

View File

@ -1,72 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.RegularExpressions;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
public class ParseVSCodeUri
{
private static readonly Regex LocalWorkspace = new Regex("^file:///(.+)$", RegexOptions.Compiled);
private static readonly Regex RemoteSSHWorkspace = new Regex(@"^vscode-remote://ssh-remote\+(.+?(?=\/))(.+)$", RegexOptions.Compiled);
private static readonly Regex RemoteWSLWorkspace = new Regex(@"^vscode-remote://wsl\+(.+?(?=\/))(.+)$", RegexOptions.Compiled);
private static readonly Regex CodespacesWorkspace = new Regex(@"^vscode-remote://vsonline\+(.+?(?=\/))(.+)$", RegexOptions.Compiled);
private static readonly Regex DevContainerWorkspace = new Regex(@"^vscode-remote://dev-container\+(.+?(?=\/))(.+)$", RegexOptions.Compiled);
public static (WorkspaceEnvironment? WorkspaceEnvironment, string MachineName, string Path) GetWorkspaceEnvironment(string uri)
{
if (LocalWorkspace.IsMatch(uri))
{
var match = LocalWorkspace.Match(uri);
if (match.Groups.Count > 1)
{
return (WorkspaceEnvironment.Local, null, match.Groups[1].Value);
}
}
else if (RemoteSSHWorkspace.IsMatch(uri))
{
var match = RemoteSSHWorkspace.Match(uri);
if (match.Groups.Count > 1)
{
return (WorkspaceEnvironment.RemoteSSH, match.Groups[1].Value, match.Groups[2].Value);
}
}
else if (RemoteWSLWorkspace.IsMatch(uri))
{
var match = RemoteWSLWorkspace.Match(uri);
if (match.Groups.Count > 1)
{
return (WorkspaceEnvironment.RemoteWSL, match.Groups[1].Value, match.Groups[2].Value);
}
}
else if (CodespacesWorkspace.IsMatch(uri))
{
var match = CodespacesWorkspace.Match(uri);
if (match.Groups.Count > 1)
{
return (WorkspaceEnvironment.Codespaces, null, match.Groups[2].Value);
}
}
else if (DevContainerWorkspace.IsMatch(uri))
{
var match = DevContainerWorkspace.Match(uri);
if (match.Groups.Count > 1)
{
return (WorkspaceEnvironment.DevContainer, null, match.Groups[2].Value);
}
}
return (null, null, null);
}
}
}

View File

@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
// Use regex to parse URI since System.Uri is not compliant with RFC 3986, see https://github.com/dotnet/runtime/issues/64707
public partial class Rfc3986Uri
{
// The following regex is referenced from https://www.rfc-editor.org/rfc/rfc3986.html#appendix-B
[GeneratedRegex(@"^((?<scheme>[^:/?#]+):)?(//(?<authority>[^/?#]*))?(?<path>[^?#]*)(\?(?<query>[^#]*))?(#(?<fragment>.*))?$")]
private static partial Regex Rfc3986();
public string Scheme { get; private set; }
public string Authority { get; private set; }
public string Path { get; private set; }
public string Query { get; private set; }
public string Fragment { get; private set; }
public static Rfc3986Uri Parse([StringSyntax("Uri")] string uriString)
{
return uriString is not null && Rfc3986().Match(uriString) is { Success: true } match
? new Rfc3986Uri()
{
Scheme = match.Groups["scheme"].Value,
Authority = match.Groups["authority"].Value,
Path = match.Groups["path"].Value,
Query = match.Groups["query"].Value,
Fragment = match.Groups["fragment"].Value,
}
: null;
}
}
}

View File

@ -29,10 +29,10 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
case WorkspaceEnvironment.Local: return Resources.TypeWorkspaceLocal;
case WorkspaceEnvironment.Codespaces: return "Codespaces";
case WorkspaceEnvironment.RemoteContainers: return Resources.TypeWorkspaceContainer;
case WorkspaceEnvironment.RemoteSSH: return "SSH";
case WorkspaceEnvironment.RemoteWSL: return "WSL";
case WorkspaceEnvironment.DevContainer: return Resources.TypeWorkspaceDevContainer;
case WorkspaceEnvironment.RemoteTunnel: return "Tunnel";
}
return string.Empty;
@ -45,8 +45,8 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
Codespaces = 2,
RemoteWSL = 3,
RemoteSSH = 4,
RemoteContainers = 5,
DevContainer = 6,
DevContainer = 5,
RemoteTunnel = 6,
}
public enum WorkspaceType

View File

@ -19,20 +19,39 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
}
private VSCodeWorkspace ParseVSCodeUri(string uri, VSCodeInstance vscodeInstance, bool isWorkspace = false)
private VSCodeWorkspace ParseVSCodeUriAndAuthority(string uri, string authority, VSCodeInstance vscodeInstance, bool isWorkspace = false)
{
if (uri != null && uri is string)
if (uri is null)
{
string unescapeUri = Uri.UnescapeDataString(uri);
var typeWorkspace = WorkspacesHelper.ParseVSCodeUri.GetWorkspaceEnvironment(unescapeUri);
if (typeWorkspace.WorkspaceEnvironment.HasValue)
return null;
}
var rfc3986Uri = Rfc3986Uri.Parse(Uri.UnescapeDataString(uri));
if (rfc3986Uri is null)
{
var folderName = Path.GetFileName(unescapeUri);
return null;
}
var (workspaceEnv, machineName) = ParseVSCodeAuthority.GetWorkspaceEnvironment(authority ?? rfc3986Uri.Authority);
if (workspaceEnv is null)
{
return null;
}
var path = rfc3986Uri.Path;
// Remove preceding '/' from local (Windows) path
if (workspaceEnv == WorkspaceEnvironment.Local)
{
path = path[1..];
}
var folderName = Path.GetFileName(path);
// Check we haven't returned '' if we have a path like C:\
if (string.IsNullOrEmpty(folderName))
{
DirectoryInfo dirInfo = new DirectoryInfo(unescapeUri);
DirectoryInfo dirInfo = new(path);
folderName = dirInfo.Name.TrimEnd(':');
}
@ -40,17 +59,13 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
Path = uri,
WorkspaceType = isWorkspace ? WorkspaceType.WorkspaceFile : WorkspaceType.ProjectFolder,
RelativePath = typeWorkspace.Path,
RelativePath = path,
FolderName = folderName,
ExtraInfo = typeWorkspace.MachineName,
WorkspaceEnvironment = typeWorkspace.WorkspaceEnvironment.Value,
ExtraInfo = machineName,
WorkspaceEnvironment = workspaceEnv ?? default,
VSCodeInstance = vscodeInstance,
};
}
}
return null;
}
public List<VSCodeWorkspace> Workspaces
{
@ -100,7 +115,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
{
foreach (var workspaceUri in vscodeStorageFile.OpenedPathsList.Workspaces3)
{
var workspace = ParseVSCodeUri(workspaceUri, vscodeInstance);
var workspace = ParseVSCodeUriAndAuthority(workspaceUri, null, vscodeInstance);
if (workspace != null)
{
storageFileResults.Add(workspace);
@ -121,7 +136,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
uri = entry.Workspace.ConfigPath;
}
var workspace = ParseVSCodeUri(uri, vscodeInstance, isWorkspaceFile);
var workspace = ParseVSCodeUriAndAuthority(uri, entry.RemoteAuthority, vscodeInstance, isWorkspaceFile);
if (workspace != null)
{
storageFileResults.Add(workspace);
@ -174,7 +189,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
uri = entry.Workspace.ConfigPath;
}
var workspace = ParseVSCodeUri(uri, vscodeInstance, isWorkspaceFile);
var workspace = ParseVSCodeUriAndAuthority(uri, entry.RemoteAuthority, vscodeInstance, isWorkspaceFile);
if (workspace != null)
{
dbFileResults.Add(workspace);

View File

@ -281,6 +281,9 @@ namespace PowerLauncher
if (option.Key != null && defaultOptions.TryGetValue(option.Key, out PluginAdditionalOption defaultOption))
{
defaultOption.Value = option.Value;
defaultOption.ComboBoxValue = option.ComboBoxValue;
defaultOption.TextValue = option.TextValue;
defaultOption.NumberValue = option.NumberValue;
}
}

View File

@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.UI.Xaml;
namespace Peek.Common.Extensions
{
public static class ApplicationExtensions
{
/// <summary>
/// Get registered services at the application level from anywhere
public static T GetService<T>(this Application application)
where T : class
{
return (application as IApp)!.GetService<T>();
}
}
}

View File

@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Peek.Common
{
public interface IApp
{
public T GetService<T>()
where T : class;
}
}

View File

@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Peek.FilePreviewer.Models
{
public interface IPreviewSettings
{
public bool SourceCodeWrapText { get; }
public bool SourceCodeTryFormat { get; }
}
}

View File

@ -0,0 +1,89 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.IO.Abstractions;
using System.Threading;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
using Settings.UI.Library;
namespace Peek.FilePreviewer.Models
{
public class PreviewSettings : IPreviewSettings
{
private const int MaxNumberOfRetry = 5;
private readonly ISettingsUtils _settingsUtils;
private readonly IFileSystemWatcher _watcher;
private readonly object _loadingSettingsLock = new();
public bool SourceCodeWrapText { get; private set; }
public bool SourceCodeTryFormat { get; private set; }
public PreviewSettings()
{
_settingsUtils = new SettingsUtils();
SourceCodeWrapText = false;
SourceCodeTryFormat = false;
LoadSettingsFromJson();
_watcher = Helper.GetFileWatcher(PeekSettings.ModuleName, PeekPreviewSettings.FileName, () => LoadSettingsFromJson());
}
private void LoadSettingsFromJson()
{
lock (_loadingSettingsLock)
{
var retry = true;
var retryCount = 0;
while (retry)
{
try
{
retryCount++;
if (!_settingsUtils.SettingsExists(PeekSettings.ModuleName, PeekPreviewSettings.FileName))
{
Logger.LogInfo("Peek preview-settings.json was missing, creating a new one");
var defaultSettings = new PeekPreviewSettings();
_settingsUtils.SaveSettings(defaultSettings.ToJsonString(), PeekSettings.ModuleName, PeekPreviewSettings.FileName);
}
var settings = _settingsUtils.GetSettingsOrDefault<PeekPreviewSettings>(PeekSettings.ModuleName, PeekPreviewSettings.FileName);
if (settings != null)
{
SourceCodeWrapText = settings.SourceCodeWrapText.Value;
SourceCodeTryFormat = settings.SourceCodeTryFormat.Value;
}
retry = false;
}
catch (IOException e)
{
if (retryCount > MaxNumberOfRetry)
{
retry = false;
Logger.LogError($"Failed to deserialize preview settings, Retrying {e.Message}", e);
}
else
{
Thread.Sleep(500);
}
}
catch (Exception ex)
{
retry = false;
Logger.LogError("Failed to read changed preview settings", ex);
}
}
}
}
}
}

View File

@ -3,7 +3,10 @@
// See the LICENSE file in the project root for more information.
using Microsoft.PowerToys.Telemetry;
using Microsoft.UI.Xaml;
using Peek.Common.Extensions;
using Peek.Common.Models;
using Peek.FilePreviewer.Models;
using Peek.FilePreviewer.Previewers.Archives;
using Peek.UI.Telemetry.Events;
@ -11,6 +14,13 @@ namespace Peek.FilePreviewer.Previewers
{
public class PreviewerFactory
{
private readonly IPreviewSettings _previewSettings;
public PreviewerFactory()
{
_previewSettings = Application.Current.GetService<IPreviewSettings>();
}
public IPreviewer Create(IFileSystemItem file)
{
if (ImagePreviewer.IsFileTypeSupported(file.Extension))
@ -23,7 +33,7 @@ namespace Peek.FilePreviewer.Previewers
}
else if (WebBrowserPreviewer.IsFileTypeSupported(file.Extension))
{
return new WebBrowserPreviewer(file);
return new WebBrowserPreviewer(file, _previewSettings);
}
else if (ArchivePreviewer.IsFileTypeSupported(file.Extension))
{

View File

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using Common.UI;
using ManagedCommon;
@ -44,15 +45,32 @@ namespace Peek.FilePreviewer.Previewers
/// <summary>
/// Prepares temp html for the previewing
/// </summary>
public static string PreviewTempFile(string fileText, string extension, string tempFolder)
public static string PreviewTempFile(string fileText, string extension, string tempFolder, bool tryFormat, bool wrapText)
{
// TODO: check if file is too big, add MaxFileSize to settings
return InitializeIndexFileAndSelectedFile(fileText, extension, tempFolder);
return InitializeIndexFileAndSelectedFile(fileText, extension, tempFolder, tryFormat, wrapText);
}
private static string InitializeIndexFileAndSelectedFile(string fileContent, string extension, string tempFolder)
private static string InitializeIndexFileAndSelectedFile(string fileContent, string extension, string tempFolder, bool tryFormat, bool wrapText)
{
string vsCodeLangSet = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguage(extension);
if (tryFormat)
{
var formatter = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.Formatters.SingleOrDefault(f => f.LangSet == vsCodeLangSet);
if (formatter != null)
{
try
{
fileContent = formatter.Format(fileContent);
}
catch (Exception ex)
{
Logger.LogError($"Failed to apply formatting", ex);
}
}
}
string base64FileCode = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(fileContent));
string theme = ThemeManager.GetWindowsBaseColor().ToLowerInvariant();
@ -60,7 +78,7 @@ namespace Peek.FilePreviewer.Previewers
string html = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.ReadIndexHtml();
html = html.Replace("[[PT_LANG]]", vsCodeLangSet, StringComparison.InvariantCulture);
html = html.Replace("[[PT_WRAP]]", "1", StringComparison.InvariantCulture); // TODO: add to settings
html = html.Replace("[[PT_WRAP]]", wrapText ? "1" : "0", StringComparison.InvariantCulture);
html = html.Replace("[[PT_THEME]]", theme, StringComparison.InvariantCulture);
html = html.Replace("[[PT_CODE]]", base64FileCode, StringComparison.InvariantCulture);
html = html.Replace("[[PT_URL]]", Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.VirtualHostName, StringComparison.InvariantCulture);

View File

@ -13,13 +13,14 @@ using Peek.Common.Extensions;
using Peek.Common.Helpers;
using Peek.Common.Models;
using Peek.FilePreviewer.Models;
using Windows.Foundation;
namespace Peek.FilePreviewer.Previewers
{
public partial class WebBrowserPreviewer : ObservableObject, IBrowserPreviewer, IDisposable
{
private static readonly HashSet<string> _supportedFileTypes = new HashSet<string>
private readonly IPreviewSettings _previewSettings;
private static readonly HashSet<string> _supportedFileTypes = new()
{
// Web
".html",
@ -43,8 +44,9 @@ namespace Peek.FilePreviewer.Previewers
private bool disposed;
public WebBrowserPreviewer(IFileSystemItem file)
public WebBrowserPreviewer(IFileSystemItem file, IPreviewSettings previewSettings)
{
_previewSettings = previewSettings;
File = file;
Dispatcher = DispatcherQueue.GetForCurrentThread();
}
@ -109,7 +111,7 @@ namespace Peek.FilePreviewer.Previewers
if (IsDevFilePreview && !isHtml && !isMarkdown)
{
var raw = await ReadHelper.Read(File.Path.ToString());
Preview = new Uri(MonacoHelper.PreviewTempFile(raw, File.Extension, TempFolderPath.Path));
Preview = new Uri(MonacoHelper.PreviewTempFile(raw, File.Extension, TempFolderPath.Path, _previewSettings.SourceCodeTryFormat, _previewSettings.SourceCodeWrapText));
}
else if (isMarkdown)
{

View File

@ -22,19 +22,6 @@ namespace Peek.UI.Extensions
return hwnd.GetMonitorScale();
}
public static void BringToForeground(this Window window)
{
// Ability to be able to set the Window to the Foreground is very limited. A current workaround is simulating mouse input before bringing to the foreground.
var windowHandle = window.GetWindowHandle();
Windows.Win32.UI.Input.KeyboardAndMouse.INPUT input = new Windows.Win32.UI.Input.KeyboardAndMouse.INPUT { type = Windows.Win32.UI.Input.KeyboardAndMouse.INPUT_TYPE.INPUT_MOUSE, Anonymous = { } };
Windows.Win32.UI.Input.KeyboardAndMouse.INPUT[] inputs = new Windows.Win32.UI.Input.KeyboardAndMouse.INPUT[] { input };
_ = PInvoke.SendInput(inputs.AsSpan<Windows.Win32.UI.Input.KeyboardAndMouse.INPUT>(), Marshal.SizeOf(typeof(Windows.Win32.UI.Input.KeyboardAndMouse.INPUT)));
if (PInvoke.SetForegroundWindow(new HWND(windowHandle)) == 0)
{
Logger.LogWarning("Couldn't set the Peek window as the foreground window.");
}
}
internal static void CenterOnMonitor(this Window window, HWND hwndDesktop, double? width = null, double? height = null)
{
var hwndToCenter = new HWND(window.GetWindowHandle());

View File

@ -4,7 +4,6 @@ GetDpiForWindow
GetForegroundWindow
SetForegroundWindow
SetActiveWindow
SendInput
GetWindowThreadProcessId
GetCurrentThreadId
AttachThreadInput

View File

@ -8,7 +8,9 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.PowerToys.Telemetry;
using Microsoft.UI.Xaml;
using Peek.Common;
using Peek.FilePreviewer;
using Peek.FilePreviewer.Models;
using Peek.UI.Telemetry.Events;
using Peek.UI.Views;
@ -17,7 +19,7 @@ namespace Peek.UI
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
public partial class App : Application, IApp
{
public static int PowerToysPID { get; set; }
@ -46,6 +48,7 @@ namespace Peek.UI
// Core Services
services.AddTransient<NeighboringItemsQuery>();
services.AddSingleton<IUserSettings, UserSettings>();
services.AddSingleton<IPreviewSettings, PreviewSettings>();
// Views and ViewModels
services.AddTransient<TitleBar>();
@ -57,7 +60,7 @@ namespace Peek.UI
UnhandledException += App_UnhandledException;
}
public static T GetService<T>()
public T GetService<T>()
where T : class
{
if ((App.Current as App)!.Host.Services.GetService(typeof(T)) is not T service)

View File

@ -8,8 +8,10 @@ using ManagedCommon;
using Microsoft.PowerToys.Telemetry;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
using Peek.Common.Constants;
using Peek.Common.Extensions;
using Peek.FilePreviewer.Models;
using Peek.UI.Extensions;
using Peek.UI.Helpers;
@ -45,7 +47,7 @@ namespace Peek.UI
Logger.LogError($"HandleThemeChange exception. Please install .NET 4.", e);
}
ViewModel = App.GetService<MainWindowViewModel>();
ViewModel = Application.Current.GetService<MainWindowViewModel>();
NativeEventWaiter.WaitForEventLoop(Constants.ShowPeekEvent(), OnPeekHotkey);
@ -68,11 +70,11 @@ namespace Peek.UI
}
}
private void PeekWindow_Activated(object sender, Microsoft.UI.Xaml.WindowActivatedEventArgs args)
private void PeekWindow_Activated(object sender, WindowActivatedEventArgs args)
{
if (args.WindowActivationState == Microsoft.UI.Xaml.WindowActivationState.Deactivated)
if (args.WindowActivationState == WindowActivationState.Deactivated)
{
var userSettings = App.GetService<IUserSettings>();
var userSettings = Application.Current.GetService<IUserSettings>();
if (userSettings.CloseAfterLosingFocus)
{
Uninitialize();
@ -184,7 +186,7 @@ namespace Peek.UI
}
this.Show();
this.BringToForeground();
WindowHelpers.BringToForeground(this.GetWindowHandle());
}
private Size GetMonitorMaxContentSize(Size monitorSize, double scaling)

View File

@ -48,7 +48,7 @@ namespace Peek.UI
if (!_settingsUtils.SettingsExists(PeekModuleName))
{
Logger.LogInfo("Hosts settings.json was missing, creating a new one");
Logger.LogInfo("Peek settings.json was missing, creating a new one");
var defaultSettings = new PeekSettings();
defaultSettings.Save(_settingsUtils);
}

View File

@ -134,7 +134,7 @@ namespace winrt::PowerRenameUI::implementation
GetDpiForMonitor(hMonitor, MONITOR_DPI_TYPE::MDT_EFFECTIVE_DPI, &x_dpi, &x_dpi);
UINT window_dpi = GetDpiForWindow(m_window);
const auto& [width, height] = CSettingsInstance().GetLastWindowSize();
const auto& [width, height] = LastRunSettingsInstance().GetLastWindowSize();
winrt::Windows::Graphics::RectInt32 rect;
// Scale window size
@ -297,12 +297,15 @@ namespace winrt::PowerRenameUI::implementation
Microsoft::UI::Windowing::AppWindow::GetFromWindowId(Microsoft::UI::GetWindowIdFromWindow(m_window));
const auto [width, height] = appWindow.Size();
CSettingsInstance().UpdateLastWindowSize(static_cast<int>(width), static_cast<int>(height));
m_updatedWindowSize.emplace(std::make_pair(width, height));
}
void MainWindow::OnClosed(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::WindowEventArgs const&)
{
CSettingsInstance().Save();
if (m_updatedWindowSize)
{
LastRunSettingsInstance().UpdateLastWindowSize(m_updatedWindowSize->first, m_updatedWindowSize->second);
}
}
void MainWindow::InvalidateItemListViewState()
@ -820,8 +823,8 @@ namespace winrt::PowerRenameUI::implementation
{
flags = CSettingsInstance().GetFlags();
textBox_search().Text(CSettingsInstance().GetSearchText().c_str());
textBox_replace().Text(CSettingsInstance().GetReplaceText().c_str());
textBox_search().Text(LastRunSettingsInstance().GetSearchText().c_str());
textBox_replace().Text(LastRunSettingsInstance().GetReplaceText().c_str());
}
else
{
@ -846,7 +849,7 @@ namespace winrt::PowerRenameUI::implementation
CSettingsInstance().SetFlags(flags);
winrt::hstring searchTerm = textBox_search().Text();
CSettingsInstance().SetSearchText(std::wstring{ searchTerm });
LastRunSettingsInstance().SetSearchText(std::wstring{ searchTerm });
if (CSettingsInstance().GetMRUEnabled() && m_searchMRU)
{
@ -858,7 +861,7 @@ namespace winrt::PowerRenameUI::implementation
}
winrt::hstring replaceTerm = textBox_replace().Text();
CSettingsInstance().SetReplaceText(std::wstring{ replaceTerm });
LastRunSettingsInstance().SetReplaceText(std::wstring{ replaceTerm });
if (CSettingsInstance().GetMRUEnabled() && m_replaceMRU)
{

View File

@ -153,6 +153,8 @@ namespace winrt::PowerRenameUI::implementation
UINT m_selectedCount = 0;
UINT m_renamingCount = 0;
winrt::event<Microsoft::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged;
std::optional<std::pair<int,int>> m_updatedWindowSize;
bool m_flagValidationInProgress = false;

View File

@ -13,6 +13,7 @@
namespace
{
const wchar_t c_powerRenameDataFilePath[] = L"\\power-rename-settings.json";
const wchar_t c_powerRenameLastRunFilePath[] = L"\\power-rename-last-run-data.json";
const wchar_t c_powerRenameUIFlagsFilePath[] = L"\\power-rename-ui-flags";
const wchar_t c_enabled[] = L"Enabled";
@ -48,11 +49,7 @@ void CSettings::Save()
jsonData.SetNamedValue(c_persistState, json::value(settings.persistState));
jsonData.SetNamedValue(c_mruEnabled, json::value(settings.MRUEnabled));
jsonData.SetNamedValue(c_maxMRUSize, json::value(settings.maxMRUSize));
jsonData.SetNamedValue(c_searchText, json::value(settings.searchText));
jsonData.SetNamedValue(c_replaceText, json::value(settings.replaceText));
jsonData.SetNamedValue(c_useBoostLib, json::value(settings.useBoostLib));
jsonData.SetNamedValue(c_lastWindowWidth, json::value(settings.lastWindowWidth));
jsonData.SetNamedValue(c_lastWindowHeight, json::value(settings.lastWindowHeight));
json::to_file(jsonFilePath, jsonData);
GetSystemTimeAsFileTime(&lastLoadedTime);
@ -94,8 +91,10 @@ void CSettings::MigrateFromRegistry()
settings.MRUEnabled = GetRegBoolean(c_mruEnabled, true);
settings.maxMRUSize = GetRegNumber(c_maxMRUSize, 10);
settings.flags = GetRegNumber(c_flags, 0);
settings.searchText = GetRegString(c_searchText, L"");
settings.replaceText = GetRegString(c_replaceText, L"");
LastRunSettingsInstance().SetSearchText(GetRegString(c_searchText, L""));
LastRunSettingsInstance().SetReplaceText(GetRegString(c_replaceText, L""));
settings.useBoostLib = false; // Never existed in registry, disabled by default.
}
@ -131,21 +130,10 @@ void CSettings::ParseJson()
{
settings.maxMRUSize = static_cast<unsigned int>(jsonSettings.GetNamedNumber(c_maxMRUSize));
}
if (json::has(jsonSettings, c_searchText, json::JsonValueType::String))
{
settings.searchText = jsonSettings.GetNamedString(c_searchText);
}
if (json::has(jsonSettings, c_replaceText, json::JsonValueType::String))
{
settings.replaceText = jsonSettings.GetNamedString(c_replaceText);
}
if (json::has(jsonSettings, c_useBoostLib, json::JsonValueType::Boolean))
{
settings.useBoostLib = jsonSettings.GetNamedBoolean(c_useBoostLib);
}
settings.lastWindowWidth = static_cast<int>(jsonSettings.GetNamedNumber(c_lastWindowWidth, DEFAULT_WINDOW_WIDTH));
settings.lastWindowHeight = static_cast<int>(jsonSettings.GetNamedNumber(c_lastWindowHeight, DEFAULT_WINDOW_HEIGHT));
}
catch (const winrt::hresult_error&)
{
@ -177,3 +165,35 @@ CSettings& CSettingsInstance()
static CSettings instance;
return instance;
}
LastRunSettings& LastRunSettingsInstance()
{
static LastRunSettings instance;
return instance;
}
void LastRunSettings::Load()
{
const auto lastRunSettingsFilePath = PTSettingsHelper::get_module_save_folder_location(PowerRenameConstants::ModuleKey) + c_powerRenameLastRunFilePath;
auto json = json::from_file(lastRunSettingsFilePath);
if (!json)
return;
json::get(*json, c_searchText, searchText, L"");
json::get(*json, c_replaceText, replaceText, L"");
json::get(*json, c_lastWindowWidth, lastWindowWidth, DEFAULT_WINDOW_WIDTH);
json::get(*json, c_lastWindowHeight, lastWindowHeight, DEFAULT_WINDOW_HEIGHT);
}
void LastRunSettings::Save()
{
json::JsonObject json;
json.SetNamedValue(c_searchText, json::value(searchText));
json.SetNamedValue(c_replaceText, json::value(replaceText));
json.SetNamedValue(c_lastWindowWidth, json::value(lastWindowWidth));
json.SetNamedValue(c_lastWindowHeight, json::value(lastWindowHeight));
const auto lastRunSettingsFilePath = PTSettingsHelper::get_module_save_folder_location(PowerRenameConstants::ModuleKey) + c_powerRenameLastRunFilePath;
json::to_file(lastRunSettingsFilePath, json);
}

View File

@ -6,9 +6,6 @@
class CSettings
{
public:
static constexpr inline int DEFAULT_WINDOW_WIDTH = 1400;
static constexpr inline int DEFAULT_WINDOW_HEIGHT = 800;
CSettings();
inline bool GetEnabled()
@ -28,17 +25,6 @@ public:
Save();
}
inline std::tuple<int, int> GetLastWindowSize() const
{
return std::make_tuple(settings.lastWindowWidth, settings.lastWindowHeight);
}
inline void UpdateLastWindowSize(const int width, const int height)
{
settings.lastWindowWidth = std::max(width, DEFAULT_WINDOW_WIDTH);
settings.lastWindowHeight = std::max(height, DEFAULT_WINDOW_HEIGHT);
}
inline bool GetShowIconOnMenu() const
{
return settings.showIconOnMenu;
@ -110,28 +96,6 @@ public:
WriteFlags();
}
inline const std::wstring& GetSearchText() const
{
return settings.searchText;
}
inline void SetSearchText(const std::wstring& text)
{
settings.searchText = text;
Save();
}
inline const std::wstring& GetReplaceText() const
{
return settings.replaceText;
}
inline void SetReplaceText(const std::wstring& text)
{
settings.replaceText = text;
Save();
}
void Save();
void Load();
@ -146,10 +110,6 @@ private:
bool MRUEnabled{ true };
unsigned int maxMRUSize{ 10 };
unsigned int flags{ 0 };
std::wstring searchText{};
std::wstring replaceText{};
int lastWindowWidth{ DEFAULT_WINDOW_WIDTH };
int lastWindowHeight{ DEFAULT_WINDOW_HEIGHT };
};
void Reload();
@ -166,3 +126,60 @@ private:
};
CSettings& CSettingsInstance();
class LastRunSettings
{
static constexpr inline int DEFAULT_WINDOW_WIDTH = 1400;
static constexpr inline int DEFAULT_WINDOW_HEIGHT = 800;
int lastWindowWidth{ DEFAULT_WINDOW_WIDTH };
int lastWindowHeight{ DEFAULT_WINDOW_HEIGHT };
std::wstring searchText{};
std::wstring replaceText{};
public:
inline LastRunSettings()
{
Load();
}
inline std::tuple<int, int> GetLastWindowSize() const
{
return std::make_tuple(lastWindowWidth, lastWindowHeight);
}
inline void UpdateLastWindowSize(const int width, const int height)
{
lastWindowWidth = std::max(width, DEFAULT_WINDOW_WIDTH);
lastWindowHeight = std::max(height, DEFAULT_WINDOW_HEIGHT);
Save();
}
inline const std::wstring& GetSearchText() const
{
return searchText;
}
inline void SetSearchText(const std::wstring& text)
{
searchText = text;
Save();
}
inline const std::wstring& GetReplaceText() const
{
return replaceText;
}
inline void SetReplaceText(const std::wstring& text)
{
replaceText = text;
Save();
}
void Load();
void Save();
};
LastRunSettings& LastRunSettingsInstance();

View File

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using ManagedCommon;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@ -98,7 +99,7 @@ namespace RegistryPreview
UpdateWindowTitle(resourceLoader.GetString("FileNotFound"));
}
ManagedCommon.WindowHelpers.BringToForeground(windowHandle);
WindowHelpers.BringToForeground(windowHandle);
}
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)

View File

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
namespace Settings.UI.Library
{
public class PeekPreviewSettings : ISettingsConfig
{
public const string FileName = "preview-settings.json";
public BoolProperty SourceCodeWrapText { get; set; }
public BoolProperty SourceCodeTryFormat { get; set; }
public PeekPreviewSettings()
{
SourceCodeWrapText = new BoolProperty(false);
SourceCodeTryFormat = new BoolProperty(false);
}
public string ToJsonString()
{
return JsonSerializer.Serialize(this);
}
public string GetModuleName()
{
return PeekSettings.ModuleName;
}
public bool UpgradeSettingsConfiguration()
{
return false;
}
}
}

View File

@ -1,37 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
namespace Microsoft.PowerToys.Settings.UI.Converters
{
public class NegativeBoolToVisibilityConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
if ((bool)value)
{
return Visibility.Collapsed;
}
return Visibility.Visible;
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
if (value is Visibility)
{
if ((Visibility)value == Visibility.Visible)
{
return false;
}
}
return true;
}
}
}

View File

@ -45,13 +45,5 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
{
}
}
public static void BecomeForegroundWindow(IntPtr hWnd)
{
NativeKeyboardHelper.INPUT input = new NativeKeyboardHelper.INPUT { type = NativeKeyboardHelper.INPUTTYPE.INPUT_MOUSE, data = { } };
NativeKeyboardHelper.INPUT[] inputs = new NativeKeyboardHelper.INPUT[] { input };
_ = NativeMethods.SendInput(1, inputs, NativeKeyboardHelper.INPUT.Size);
NativeMethods.SetForegroundWindow(hWnd);
}
}
}

View File

@ -21,9 +21,6 @@
<!-- MRT from windows app sdk will search for a pri file with the same name of the module before defaulting to resources.pri -->
<ProjectPriFileName>PowerToys.Settings.pri</ProjectPriFileName>
</PropertyGroup>
<ItemGroup>
<None Remove="SettingsXAML\Views\DashboardPage.xaml" />
</ItemGroup>
<ItemGroup>
<Page Remove="SettingsXAML\App.xaml" />
@ -128,10 +125,4 @@
</None>
</ItemGroup>
<ItemGroup>
<Page Update="SettingsXAML\Views\DashboardPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>
</Project>

View File

@ -170,7 +170,7 @@ namespace Microsoft.PowerToys.Settings.UI
// https://github.com/microsoft/microsoft-ui-xaml/issues/7595 - Activate doesn't bring window to the foreground
// Need to call SetForegroundWindow to actually gain focus.
Utils.BecomeForegroundWindow(settingsWindow.GetWindowHandle());
WindowHelpers.BringToForeground(settingsWindow.GetWindowHandle());
}
else
{

View File

@ -11,36 +11,20 @@
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="Black" />
<SolidColorBrush
x:Key="SolidZoneNumberBrush"
Color="White" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" />
<SolidColorBrush x:Key="SolidZoneNumberBrush" Color="White" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="White" />
<SolidColorBrush
x:Key="SolidZoneNumberBrush"
Color="Black" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="White" />
<SolidColorBrush x:Key="SolidZoneNumberBrush" Color="Black" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="Black" />
<SolidColorBrush
x:Key="SolidZoneNumberBrush"
Color="White" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" />
<SolidColorBrush x:Key="SolidZoneNumberBrush" Color="White" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<SolidColorBrush
x:Key="DefaultAccentBrush"
Color="{ThemeResource SystemAccentColor}" />
<SolidColorBrush
x:Key="DefaultBorderBrush"
Color="{ThemeResource SystemAccentColor}" />
<SolidColorBrush x:Key="DefaultAccentBrush" Color="{ThemeResource SystemAccentColor}" />
<SolidColorBrush x:Key="DefaultBorderBrush" Color="{ThemeResource SystemAccentColor}" />
</ResourceDictionary>
</UserControl.Resources>
@ -64,8 +48,8 @@
<Border
Grid.RowSpan="2"
Grid.ColumnSpan="2"
Opacity="0.8"
CornerRadius="4">
CornerRadius="4"
Opacity="0.8">
<Image
AutomationProperties.AccessibilityView="Raw"
Source="{x:Bind WallpaperPath, Mode=OneWay}"
@ -75,10 +59,10 @@
<Border
x:Name="Zone1"
Grid.RowSpan="2"
BorderThickness="1"
Margin="4,4,2,4"
CornerRadius="2"
Background="{ThemeResource SystemControlAcrylicElementBrush}">
Background="{ThemeResource SystemControlAcrylicElementBrush}"
BorderThickness="1"
CornerRadius="2">
<TextBlock
x:Name="Zone1Number"
HorizontalAlignment="Center"
@ -90,10 +74,10 @@
<Border
x:Name="Zone2"
Grid.Column="1"
BorderThickness="1"
Margin="2,4,4,2"
CornerRadius="2"
Background="{ThemeResource SystemControlAcrylicElementBrush}">
Background="{ThemeResource SystemControlAcrylicElementBrush}"
BorderThickness="1"
CornerRadius="2">
<TextBlock
x:Name="Zone2Number"
HorizontalAlignment="Center"
@ -106,10 +90,10 @@
x:Name="Zone3"
Grid.Row="1"
Grid.Column="1"
BorderThickness="1"
Margin="2,2,4,4"
CornerRadius="2"
Background="{ThemeResource SystemControlAcrylicElementBrush}">
Background="{ThemeResource SystemControlAcrylicElementBrush}"
BorderThickness="1"
CornerRadius="2">
<TextBlock
x:Name="Zone3Number"
HorizontalAlignment="Center"

View File

@ -35,9 +35,8 @@
</Style>
<Style
x:Key="SecondaryIsEnabledTextBlockStyle"
TargetType="local:IsEnabledTextBlock"
BasedOn="{StaticResource DefaultIsEnabledTextBlockStyle}"
>
TargetType="local:IsEnabledTextBlock">
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
<Setter Property="FontSize" Value="{StaticResource SecondaryTextFontSize}" />
</Style>

View File

@ -21,6 +21,26 @@
<Setter.Value>
<ControlTemplate TargetType="local:KeyVisual">
<Grid>
<Grid>
<Rectangle
x:Name="ContentHolder"
Height="{TemplateBinding Height}"
MinWidth="{TemplateBinding MinWidth}"
Fill="{TemplateBinding Background}"
RadiusX="4"
RadiusY="4"
Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}" />
<ContentPresenter
x:Name="KeyPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}" />
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
@ -45,26 +65,6 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Rectangle
x:Name="ContentHolder"
Height="{TemplateBinding Height}"
MinWidth="{TemplateBinding MinWidth}"
Fill="{TemplateBinding Background}"
RadiusX="4"
RadiusY="4"
Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}" />
<ContentPresenter
x:Name="KeyPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}" />
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@ -22,9 +22,7 @@
ItemsSource="{x:Bind Keys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
Orientation="Horizontal"
Spacing="4" />
<StackPanel Orientation="Horizontal" Spacing="4" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>

View File

@ -2,8 +2,8 @@
x:Class="Microsoft.PowerToys.Settings.UI.Controls.SettingsPageControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:custom="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -24,25 +24,6 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="DescriptionPanel.(Grid.Row)" Value="1" />
<Setter Target="DescriptionPanel.(Grid.Column)" Value="0" />
<Setter Target="DescriptionPanel.(Grid.ColumnSpan)" Value="2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBlock
x:Name="Header"
MaxWidth="{StaticResource PageMaxWidth}"
@ -157,5 +138,24 @@
</StackPanel>
</Grid>
</ScrollViewer>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="DescriptionPanel.(Grid.Row)" Value="1" />
<Setter Target="DescriptionPanel.(Grid.Column)" Value="0" />
<Setter Target="DescriptionPanel.(Grid.ColumnSpan)" Value="2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</UserControl>

View File

@ -8,17 +8,14 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
x:Name="ShortcutContentControl"
mc:Ignorable="d">
<Grid
MinWidth="498"
MinHeight="220">
<Grid MinWidth="498" MinHeight="220">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition MinHeight="110" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0" />
<TextBlock Grid.Row="0" />
<ItemsControl
x:Name="KeysControl"
@ -31,9 +28,7 @@
ItemsSource="{x:Bind Keys, Mode=OneWay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
Orientation="Horizontal"
Spacing="8" />
<StackPanel Orientation="Horizontal" Spacing="8" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
@ -57,7 +52,8 @@
Spacing="8">
<Grid Height="62">
<InfoBar x:Uid="InvalidShortcut"
<InfoBar
x:Uid="InvalidShortcut"
IsClosable="False"
IsOpen="{Binding ElementName=ShortcutContentControl, Path=IsError, Mode=OneWay}"
IsTabStop="{Binding ElementName=ShortcutContentControl, Path=IsError, Mode=OneWay}"

View File

@ -1,16 +1,23 @@
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. -->
<Page
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.AppsListPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="using:Microsoft.PowerToys.Settings.UI.ViewModels"
mc:Ignorable="d">
<Page.Resources>
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
<converters:BoolToVisibilityConverter
x:Key="BoolToInvertedVisibilityConverter"
FalseValue="Visible"
TrueValue="Collapsed" />
</Page.Resources>
<Grid Background="{ThemeResource LayerOnAcrylicFillColorDefaultBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -59,11 +66,13 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--<ViewBox VerticalAlignment="Center">-->
<Image
Width="20"
Margin="0,0,16,0">
Margin="0,0,16,0"
VerticalAlignment="Center">
<Image.Source>
<BitmapImage UriSource="{x:Bind Icon, Mode=OneWay}" />
</Image.Source>
@ -74,12 +83,26 @@
VerticalAlignment="Center"
Text="{x:Bind Label, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<ToggleSwitch
<FontIcon
Grid.Column="2"
Margin="0,0,0,0"
Width="20"
VerticalAlignment="Center"
FontSize="16"
Glyph="&#xE72E;"
Visibility="{x:Bind IsLocked, Converter={StaticResource BoolToInvertedVisibilityConverter}, ConverterParameter=True, Mode=OneWay}">
<ToolTipService.ToolTip>
<TextBlock x:Uid="GPO_IsSettingForcedText" TextWrapping="WrapWholeWords" />
</ToolTipService.ToolTip>
</FontIcon>
<ToggleSwitch
Grid.Column="3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
AutomationProperties.Name="{x:Bind Label, Mode=OneWay}"
IsEnabled="{x:Bind IsLocked, Converter={StaticResource BoolNegationConverter}, ConverterParameter=True, Mode=OneWay}"
IsOn="{x:Bind IsEnabled, Mode=TwoWay}"
OffContent=""
OnContent=""
Style="{StaticResource RightAlignedCompactToggleSwitchStyle}" />
</Grid>
</DataTemplate>

View File

@ -33,6 +33,10 @@ namespace Microsoft.PowerToys.Settings.UI.Flyout
{
FlyoutMenuButton selectedModuleBtn = sender as FlyoutMenuButton;
bool moduleRun = true;
// Closing manually the flyout to workaround focus gain problems
App.GetFlyoutWindow()?.Hide();
switch ((string)selectedModuleBtn.Tag)
{
case "ColorPicker": // Launch ColorPicker

View File

@ -1,14 +1,14 @@
<winuiex:WindowEx
<winuiex:WindowEx
x:Class="Microsoft.PowerToys.Settings.UI.FlyoutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flyout="using:Microsoft.PowerToys.Settings.UI.Flyout"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
xmlns:local="using:Microsoft.PowerToys.Settings.UI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winuiex="using:WinUIEx"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
Title="PowerToys Settings"
IsAlwaysOnTop="True"
IsMaximizable="False"
@ -36,12 +36,8 @@
Binding="{x:Bind ViewModel.Windows10}"
ComparisonCondition="Equal"
Value="True">
<ic:ChangePropertyAction
PropertyName="BorderThickness"
Value="1" />
<ic:ChangePropertyAction
PropertyName="BorderBrush"
Value="{ThemeResource SurfaceStrokeColorDefaultBrush}" />
<ic:ChangePropertyAction PropertyName="BorderThickness" Value="1" />
<ic:ChangePropertyAction PropertyName="BorderBrush" Value="{ThemeResource SurfaceStrokeColorDefaultBrush}" />
</ic:DataTriggerBehavior>
</i:Interaction.Behaviors>
<flyout:ShellPage x:Name="FlyoutShellPage" />

View File

@ -1,4 +1,4 @@
<winuiex:WindowEx
<winuiex:WindowEx
x:Class="Microsoft.PowerToys.Settings.UI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

View File

@ -205,7 +205,7 @@ namespace Microsoft.PowerToys.Settings.UI
// https://github.com/microsoft/microsoft-ui-xaml/issues/7595 - Activate doesn't bring window to the foreground
// Need to call SetForegroundWindow to actually gain focus.
Utils.BecomeForegroundWindow(flyout.GetWindowHandle());
WindowHelpers.BringToForeground(flyout.GetWindowHandle());
});
});

View File

@ -9,40 +9,24 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_AlwaysOnTop"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/AlwaysOnTop.png">
<custom:OOBEPageControl x:Uid="Oobe_AlwaysOnTop" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/AlwaysOnTop.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_AlwaysOnTop_HowToUse" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_AlwaysOnTop_HowToUse" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_AlwaysOnTop_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_AlwaysOnTop_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_AlwaysOnTop"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_AlwaysOnTop"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_AlwaysOnTop" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_AlwaysOnTop" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,41 +8,25 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_Awake"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Awake.png">
<custom:OOBEPageControl x:Uid="Oobe_Awake" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Awake.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_Awake_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_Awake_HowToUse" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_Awake_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_Awake_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_Awake"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_Awake"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_Awake" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Awake" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,27 +9,17 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_ColorPicker"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ColorPicker.gif">
<custom:OOBEPageControl x:Uid="Oobe_ColorPicker" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ColorPicker.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_ColorPicker_HowToUse" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_ColorPicker_HowToUse" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_ColorPicker_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_ColorPicker_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
@ -39,15 +29,9 @@
x:Uid="Launch_ColorPicker"
Click="Start_ColorPicker_Click"
Style="{StaticResource AccentButtonStyle}" />
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_ColorPicker"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_ColorPicker"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ColorPicker" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ColorPicker" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,36 +9,22 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_CropAndLock"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/CropAndLock.gif">
<custom:OOBEPageControl x:Uid="Oobe_CropAndLock" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/CropAndLock.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="ThumbnailHotkeyControl"
x:Uid="Oobe_CropAndLock_HowToUse_Thumbnail" />
<custom:ShortcutWithTextLabelControl x:Name="ThumbnailHotkeyControl" x:Uid="Oobe_CropAndLock_HowToUse_Thumbnail" />
<custom:ShortcutWithTextLabelControl
x:Name="ReparentHotkeyControl"
x:Uid="Oobe_CropAndLock_HowToUse_Reparent" />
<custom:ShortcutWithTextLabelControl x:Name="ReparentHotkeyControl" x:Uid="Oobe_CropAndLock_HowToUse_Reparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_CropAndLock"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_CropAndLock"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_CropAndLock" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_CropAndLock" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -1,4 +1,4 @@
<Page
<Page
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFancyZones"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -8,44 +8,26 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_FancyZones"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FancyZones.gif">
<custom:OOBEPageControl x:Uid="Oobe_FancyZones" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FancyZones.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_FancyZones_HowToUse"
Background="Transparent" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_FancyZones_HowToUse_Shortcut" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_FancyZones_HowToUse" Background="Transparent" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_FancyZones_HowToUse_Shortcut" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_FancyZones_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_FancyZones_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_FancyZones"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_FancyZones"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_FancyZones" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_FancyZones" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,33 +9,21 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_FileExplorer"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FileExplorer.png">
<custom:OOBEPageControl x:Uid="Oobe_FileExplorer" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FileExplorer.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToEnable"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToEnable" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_FileExplorer_HowToEnable"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_FileExplorer_HowToEnable" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_FileExplorerAddOns"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_PowerPreview"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_FileExplorerAddOns" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_PowerPreview" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,42 +8,26 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_FileLocksmith"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FileLocksmith.gif">
<custom:OOBEPageControl x:Uid="Oobe_FileLocksmith" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/FileLocksmith.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_FileLocksmith_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_FileLocksmith_HowToUse" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_FileLocksmith_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_FileLocksmith_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_FileLocksmith"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_FileLocksmith"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_FileLocksmith" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_FileLocksmith" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,9 +9,7 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_Hosts"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/HostsFileEditor.png">
<custom:OOBEPageControl x:Uid="Oobe_Hosts" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/HostsFileEditor.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<StackPanel
@ -22,15 +20,9 @@
x:Uid="Launch_Hosts"
Click="Launch_Hosts_Click"
Style="{StaticResource AccentButtonStyle}" />
<Button
x:Uid="OOBE_Settings"
Click="Launch_Settings_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_HostsFileEditor"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_Hosts"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="Launch_Settings_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_HostsFileEditor" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Hosts" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,41 +9,25 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_ImageResizer"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ImageResizer.gif">
<custom:OOBEPageControl x:Uid="Oobe_ImageResizer" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ImageResizer.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToLaunch" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_ImageResizer_HowToLaunch"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_ImageResizer_HowToLaunch" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_ImageResizer_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_ImageResizer_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_ImageResizer"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_ImageResizer"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ImageResizer" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ImageResizer" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -7,42 +7,26 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_KBM"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/KBM.gif">
<custom:OOBEPageControl x:Uid="Oobe_KBM" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/KBM.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToCreateMappings"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToCreateMappings" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_KBM_HowToCreateMappings"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_KBM_HowToCreateMappings" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_KBM_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_KBM_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_KeyboardManager"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_KBM"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_KeyboardManager" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_KBM" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,37 +9,23 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_MeasureTool"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ScreenRuler.gif">
<custom:OOBEPageControl x:Uid="Oobe_MeasureTool" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/ScreenRuler.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToLaunch" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyActivation"
x:Uid="Oobe_MeasureTool_Activation" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyActivation" x:Uid="Oobe_MeasureTool_Activation" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MeasureTool_HowToLaunch"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MeasureTool_HowToLaunch" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_ScreenRuler"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_MeasureTool"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ScreenRuler" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_MeasureTool" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,53 +8,29 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_MouseUtils"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/MouseUtils.gif">
<custom:OOBEPageControl x:Uid="Oobe_MouseUtils" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/MouseUtils.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_MouseUtils_FindMyMouse"
Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseUtils_FindMyMouse_Description"
Background="Transparent" />
<TextBlock x:Uid="Oobe_MouseUtils_FindMyMouse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseUtils_FindMyMouse_Description" Background="Transparent" />
<TextBlock
x:Uid="Oobe_MouseUtils_MouseHighlighter"
Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseUtils_MouseHighlighter_Description"
Background="Transparent" />
<TextBlock x:Uid="Oobe_MouseUtils_MouseHighlighter" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseUtils_MouseHighlighter_Description" Background="Transparent" />
<TextBlock
x:Uid="Oobe_MouseUtils_MousePointerCrosshairs"
Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseUtils_MousePointerCrosshairs_Description"
Background="Transparent" />
<TextBlock x:Uid="Oobe_MouseUtils_MousePointerCrosshairs" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseUtils_MousePointerCrosshairs_Description" Background="Transparent" />
<TextBlock
x:Uid="Oobe_MouseUtils_MouseJump"
Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseUtils_MouseJump_Description"
Background="Transparent" />
<TextBlock x:Uid="Oobe_MouseUtils_MouseJump" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseUtils_MouseJump_Description" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_MouseUtilities"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_MouseUtils"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_MouseUtilities" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_MouseUtils" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>

View File

@ -8,42 +8,26 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_MouseWithoutBorders"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/MouseWithoutBorders.png">
<custom:OOBEPageControl x:Uid="Oobe_MouseWithoutBorders" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/MouseWithoutBorders.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseWithoutBorders_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseWithoutBorders_HowToUse" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_MouseWithoutBorders_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_MouseWithoutBorders_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_MouseWithoutBorders"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_MouseWithoutBorders"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_MouseWithoutBorders" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_MouseWithoutBorders" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,31 +8,21 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_Overview"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/OOBEPTHero.png">
<custom:OOBEPageControl x:Uid="Oobe_Overview" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/OOBEPTHero.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="Oobe_Overview_DescriptionLinkText"
TextWrapping="Wrap" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="Oobe_Overview_DescriptionLinkText" TextWrapping="Wrap" />
</HyperlinkButton>
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
</StackPanel>
</StackPanel>
</custom:OOBEPageControl.PageContent>

View File

@ -1,16 +1,16 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<!-- Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Page
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverviewPlaceholder"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Loaded="Page_Loaded"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
mc:Ignorable="d">
<Grid Margin="0,24,0,0">
<ProgressRing

View File

@ -9,33 +9,21 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_PastePlain"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PastePlain.gif">
<custom:OOBEPageControl x:Uid="Oobe_PastePlain" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PastePlain.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_PastePlain_HowToUse" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_PastePlain_HowToUse" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_PastePlain"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_PastePlain"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PastePlain" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_PastePlain" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -1,4 +1,4 @@
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. -->
<Page
@ -6,40 +6,28 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_Peek"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Peek.gif">
<custom:OOBEPageControl x:Uid="Oobe_Peek" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Peek.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_Peek_HowToUse" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_Peek_HowToUse" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_Peek"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_Peek"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_Peek" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Peek" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,33 +9,21 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_QuickAccent"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerAccent.gif">
<custom:OOBEPageControl x:Uid="Oobe_QuickAccent" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerAccent.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_QuickAccent_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_QuickAccent_HowToUse" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_QuickAccent"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_QuickAccent"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_QuickAccent" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_QuickAccent" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,41 +9,25 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_TextExtractor"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerOCR.gif">
<custom:OOBEPageControl x:Uid="Oobe_TextExtractor" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerOCR.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_TextExtractor_HowToUse" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_TextExtractor_HowToUse" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_TextExtractor_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_TextExtractor_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_TextExtractor"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_TextExtractor"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_TextExtractor" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_TextExtractor" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,42 +8,26 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_PowerRename"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerRename.gif">
<custom:OOBEPageControl x:Uid="Oobe_PowerRename" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/PowerRename.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_PowerRename_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_PowerRename_HowToUse" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_PowerRename_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_PowerRename_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_PowerRename"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_PowerRename"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerRename" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_PowerRename" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,28 +8,18 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_RegistryPreview"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/RegistryPreview.png">
<custom:OOBEPageControl x:Uid="Oobe_RegistryPreview" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/RegistryPreview.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToUse" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_RegistryPreview_HowToUse"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_RegistryPreview_HowToUse" Background="Transparent" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_RegistryPreview_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_RegistryPreview_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
@ -39,15 +29,9 @@
x:Uid="Launch_RegistryPreview"
Click="Launch_RegistryPreview_Click"
Style="{StaticResource AccentButtonStyle}" />
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_RegistryPreview"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_RegistryPreview"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_RegistryPreview" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_RegistryPreview" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,27 +9,17 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_Run"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Run.gif">
<custom:OOBEPageControl x:Uid="Oobe_Run" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/Run.gif">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToLaunch" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_Run_HowToLaunch" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_Run_HowToLaunch" />
<TextBlock
x:Uid="Oobe_TipsAndTricks"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_TipsAndTricks" Style="{ThemeResource OobeSubtitleStyle}" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_Run_TipsAndTricks"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_Run_TipsAndTricks" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
@ -39,15 +29,9 @@
x:Uid="Launch_Run"
Click="Start_Run_Click"
Style="{StaticResource AccentButtonStyle}" />
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_PowerToysRun"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_Run"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerToysRun" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Run" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -8,19 +8,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_ShortcutGuide"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/OOBEShortcutGuide.png">
<custom:OOBEPageControl x:Uid="Oobe_ShortcutGuide" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/OOBEShortcutGuide.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToLaunch" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyControl"
x:Uid="Oobe_ShortcutGuide_HowToLaunch" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyControl" x:Uid="Oobe_ShortcutGuide_HowToLaunch" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
@ -29,15 +23,9 @@
x:Uid="Launch_ShortcutGuide"
Click="Start_ShortcutGuide_Click"
Style="{StaticResource AccentButtonStyle}" />
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_ShortcutGuide"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_ShortcutGuide"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ShortcutGuide" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ShortcutGuide" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -9,46 +9,26 @@
xmlns:toolkitcontrols="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<custom:OOBEPageControl
x:Uid="Oobe_VideoConference"
HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/VideoConferenceMute.png">
<custom:OOBEPageControl x:Uid="Oobe_VideoConference" HeroImage="ms-appx:///Assets/Settings/Modules/OOBE/VideoConferenceMute.png">
<custom:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock
x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
<TextBlock x:Uid="Oobe_HowToLaunch" Style="{ThemeResource OobeSubtitleStyle}" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyMicVidControl"
x:Uid="Oobe_VideoConference_ToggleMicVid" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyMicControl"
x:Uid="Oobe_VideoConference_ToggleMic" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyPushToTalkControl"
x:Uid="Oobe_VideoConference_PushToTalkMic" />
<custom:ShortcutWithTextLabelControl
x:Name="HotkeyVidControl"
x:Uid="Oobe_VideoConference_ToggleVid" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyMicVidControl" x:Uid="Oobe_VideoConference_ToggleMicVid" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyMicControl" x:Uid="Oobe_VideoConference_ToggleMic" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyPushToTalkControl" x:Uid="Oobe_VideoConference_PushToTalkMic" />
<custom:ShortcutWithTextLabelControl x:Name="HotkeyVidControl" x:Uid="Oobe_VideoConference_ToggleVid" />
<toolkitcontrols:MarkdownTextBlock
x:Uid="Oobe_VideoConference_HowToLaunch"
Background="Transparent" />
<toolkitcontrols:MarkdownTextBlock x:Uid="Oobe_VideoConference_HowToLaunch" Background="Transparent" />
<StackPanel
Margin="0,24,0,0"
Orientation="Horizontal"
Spacing="12">
<Button
x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click" />
<HyperlinkButton
NavigateUri="https://aka.ms/PowerToysOverview_VideoConference"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="LearnMore_VCM"
TextWrapping="Wrap" />
<Button x:Uid="OOBE_Settings" Click="SettingsLaunchButton_Click" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_VideoConference" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_VCM" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>

View File

@ -30,9 +30,7 @@
Margin="0,0,0,16"
NavigateUri="https://github.com/microsoft/PowerToys/releases"
Style="{StaticResource TextButtonStyle}">
<TextBlock
x:Uid="Oobe_WhatsNew_DetailedReleaseNotesLink"
TextWrapping="Wrap" />
<TextBlock x:Uid="Oobe_WhatsNew_DetailedReleaseNotesLink" TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
<InfoBar
@ -53,9 +51,7 @@
IsOpen="False"
IsTabStop="True"
Severity="Warning" />
<ScrollViewer
Grid.Row="1"
VerticalScrollBarVisibility="Auto">
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<Grid Margin="32,24,32,24">
<ProgressRing
x:Name="LoadingProgressRing"

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,6 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="OobeSubtitleStyle"
TargetType="TextBlock">
<Style x:Key="OobeSubtitleStyle" TargetType="TextBlock">
<Setter Property="Margin" Value="0,16,0,0" />
<Setter Property="Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="AutomationProperties.HeadingLevel" Value="Level3" />

View File

@ -1,35 +1,21 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush
x:Key="InfoBarInformationalSeverityBackgroundBrush"
Color="#FF34424d" />
<SolidColorBrush x:Key="InfoBarInformationalSeverityBackgroundBrush" Color="#FF34424d" />
<Color x:Key="InfoBarInformationalSeverityIconBackground">#FF5fb2f2</Color>
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="Black" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush
x:Key="InfoBarInformationalSeverityBackgroundBrush"
Color="#FFd3e7f7" />
<SolidColorBrush x:Key="InfoBarInformationalSeverityBackgroundBrush" Color="#FFd3e7f7" />
<Color x:Key="InfoBarInformationalSeverityIconBackground">#FF0063b1</Color>
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="White" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="White" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush
x:Key="InfoBarInformationalSeverityBackgroundBrush"
Color="#FF34424d" />
<SolidColorBrush
x:Key="SolidBackgroundBrush"
Color="Black" />
<SolidColorBrush x:Key="InfoBarInformationalSeverityBackgroundBrush" Color="#FF34424d" />
<SolidColorBrush x:Key="SolidBackgroundBrush" Color="Black" />
<Color x:Key="InfoBarInformationalSeverityIconBackground">#FF5fb2f2</Color>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

View File

@ -1,4 +1,4 @@
<Page
<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.ColorPickerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -160,9 +160,9 @@
<ContentDialog
x:Name="ColorFormatDialog"
x:Uid="ColorFormatDialog"
Closed="ColorFormatDialog_Closed"
IsPrimaryButtonEnabled="{Binding IsValid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
PrimaryButtonStyle="{ThemeResource AccentButtonStyle}"
Closed="ColorFormatDialog_Closed">
PrimaryButtonStyle="{ThemeResource AccentButtonStyle}">
<ContentDialog.DataContext>
<models:ColorFormatModel />
</ContentDialog.DataContext>

View File

@ -1,4 +1,4 @@
<Page
<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

View File

@ -196,7 +196,7 @@
<NumberBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
LargeChange="100"
Minimum="100"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.MouseHighlighterFadeDelayMs}" />
@ -205,7 +205,7 @@
<NumberBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
LargeChange="100"
Minimum="100"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.MouseHighlighterFadeDurationMs}" />

View File

@ -40,6 +40,25 @@
</controls:SettingsCard>
</custom:SettingsGroup>
<custom:SettingsGroup x:Uid="Peek_Preview_GroupSettings" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:SettingsExpander
x:Uid="Peek_SourceCode_Header"
HeaderIcon="{ui:FontIcon Glyph=&#xE99A;}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:SettingsExpander.Items>
<controls:SettingsCard ContentAlignment="Left" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<CheckBox x:Uid="Peek_SourceCode_WrapText" IsChecked="{x:Bind ViewModel.SourceCodeWrapText, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard ContentAlignment="Left" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<custom:CheckBoxWithDescriptionControl
x:Uid="Peek_SourceCode_TryFormat"
IsChecked="{x:Bind ViewModel.SourceCodeTryFormat, Mode=TwoWay}"
IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}" />
</controls:SettingsCard>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
</custom:SettingsGroup>
</StackPanel>
</custom:SettingsPageControl.ModuleContent>
<custom:SettingsPageControl.PrimaryLinks>

View File

@ -1,4 +1,4 @@
<Page
<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerLauncherPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -298,7 +298,10 @@
Visibility="{x:Bind ShowBadgeOnPluginSettingError}" />
</Grid>
<ToggleSwitch x:Uid="PowerLauncher_EnablePluginToggle" IsOn="{x:Bind Path=Disabled, Converter={StaticResource BoolNegationConverter}, Mode=TwoWay}" IsEnabled="{x:Bind Path=EnabledGpoRuleIsConfigured, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
<ToggleSwitch
x:Uid="PowerLauncher_EnablePluginToggle"
IsEnabled="{x:Bind Path=EnabledGpoRuleIsConfigured, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
IsOn="{x:Bind Path=Disabled, Converter={StaticResource BoolNegationConverter}, Mode=TwoWay}" />
</StackPanel>
<controls:SettingsExpander.Items>

View File

@ -3022,7 +3022,7 @@ Activate by holding the key for the character you want to add an accent to, then
<value>Find the mouse</value>
</data>
<data name="ImageResizer_ShortDescription" xml:space="preserve">
<value>Select Image Resizer in the right-click context menu</value>
<value>Resize images from right-click context menu</value>
</data>
<data name="MouseHighlighter_ShortDescription" xml:space="preserve">
<value>Highlight clicks</value>
@ -3043,7 +3043,7 @@ Activate by holding the key for the character you want to add an accent to, then
<value>Quick and easy previewer</value>
</data>
<data name="PowerRename_ShortDescription" xml:space="preserve">
<value>Select Power Rename in right-click context menu</value>
<value>Rename files and folders from right-click context menu</value>
</data>
<data name="Run_ShortDescription" xml:space="preserve">
<value>A quick launcher</value>
@ -3838,4 +3838,22 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="EnabledModules.Text" xml:space="preserve">
<value>Enabled modules</value>
</data>
<data name="Peek_Preview_GroupSettings.Header" xml:space="preserve">
<value>Preview</value>
</data>
<data name="Peek_SourceCode_Header.Description" xml:space="preserve">
<value>.cpp, .py, .json, .xml, .csproj, ...</value>
</data>
<data name="Peek_SourceCode_Header.Header" xml:space="preserve">
<value>Source code files (Monaco)</value>
</data>
<data name="Peek_SourceCode_TryFormat.Description" xml:space="preserve">
<value>Applies to json and xml. Files remain unchanged.</value>
</data>
<data name="Peek_SourceCode_TryFormat.Header" xml:space="preserve">
<value>Try to format the source for preview</value>
</data>
<data name="Peek_SourceCode_WrapText.Content" xml:space="preserve">
<value>Wrap text</value>
</data>
</root>

View File

@ -54,7 +54,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_excludedApps = Settings.Properties.ExcludedApps.Value;
_windows11 = Helper.Windows11();
// set the callback functions value to hangle outgoing IPC message.
// set the callback functions value to handle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
}

View File

@ -67,7 +67,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
InitializeEnabledValue();
// set the callback functions value to hangle outgoing IPC message.
// set the callback functions value to handle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
_delayedTimer = new Timer();

Some files were not shown because too many files have changed in this diff Show More