mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[WinUI3]Fix Windows 10 title bar borders (#36429)
* Fix borders for windows in the Settings UI * Fix HOSTS window * Fix Advanced Paste * Fix Environment Variables * Fix File Locksmith * Fix Peek, with a caveat * Fix Registry Preview * Remove unused imports * Clean up imports in OobeShellPage * Move OSVersionHelper from Common.UI up into ManagedCommon
This commit is contained in:
@@ -38,8 +38,8 @@ namespace RegistryPreview
|
||||
OpenWindowPlacementFile(settingsFolder, windowPlacementFile);
|
||||
|
||||
// Update the Win32 looking window with the correct icon (and grab the appWindow handle for later)
|
||||
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(this);
|
||||
Microsoft.UI.WindowId windowId = Win32Interop.GetWindowIdFromWindow(windowHandle);
|
||||
IntPtr windowHandle = this.GetWindowHandle();
|
||||
WindowId windowId = Win32Interop.GetWindowIdFromWindow(windowHandle);
|
||||
appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
|
||||
appWindow.SetIcon("Assets\\RegistryPreview\\RegistryPreview.ico");
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace RegistryPreview
|
||||
|
||||
// Extend the canvas to include the title bar so the app can support theming
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(windowHandle);
|
||||
SetTitleBar(titleBar);
|
||||
|
||||
// if have settings, update the location of the window
|
||||
|
||||
Reference in New Issue
Block a user