mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +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:
@@ -241,6 +241,10 @@ 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.
|
||||
WindowHelpers.BringToForeground(settingsWindow.GetWindowHandle());
|
||||
|
||||
// https://github.com/microsoft/microsoft-ui-xaml/issues/8948 - A window's top border incorrectly
|
||||
// renders as black on Windows 10.
|
||||
WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(WindowNative.GetWindowHandle(settingsWindow));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -255,6 +259,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
OobeWindow oobeWindow = new OobeWindow(OOBE.Enums.PowerToysModules.Overview);
|
||||
oobeWindow.Activate();
|
||||
oobeWindow.ExtendsContentIntoTitleBar = true;
|
||||
WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(WindowNative.GetWindowHandle(settingsWindow));
|
||||
SetOobeWindow(oobeWindow);
|
||||
}
|
||||
else if (ShowScoobe)
|
||||
@@ -263,6 +268,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
OobeWindow scoobeWindow = new OobeWindow(OOBE.Enums.PowerToysModules.WhatsNew);
|
||||
scoobeWindow.Activate();
|
||||
scoobeWindow.ExtendsContentIntoTitleBar = true;
|
||||
WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(WindowNative.GetWindowHandle(settingsWindow));
|
||||
SetOobeWindow(scoobeWindow);
|
||||
}
|
||||
else if (ShowFlyout)
|
||||
@@ -310,6 +316,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
// Window is also needed to show MessageDialog
|
||||
settingsWindow = new MainWindow();
|
||||
settingsWindow.ExtendsContentIntoTitleBar = true;
|
||||
WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(WindowNative.GetWindowHandle(settingsWindow));
|
||||
settingsWindow.Activate();
|
||||
settingsWindow.NavigateToSection(StartupPage);
|
||||
ShowMessageDialog("The application is running in Debug mode.", "DEBUG");
|
||||
|
||||
Reference in New Issue
Block a user