[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:
Neil McAlister
2025-01-13 17:13:16 +02:00
committed by GitHub
parent aa9f3bb540
commit df48a33bb9
23 changed files with 68 additions and 25 deletions

View File

@@ -6,6 +6,7 @@ using System;
using System.IO;
using System.Windows;
using System.Windows.Media;
using ManagedCommon;
using Microsoft.Win32;
using Wox.Infrastructure.Image;
using Wox.Infrastructure.UserSettings;
@@ -50,7 +51,7 @@ namespace PowerLauncher.Helper
private void SetSystemTheme(ManagedCommon.Theme theme)
{
_mainWindow.Background = Common.UI.OSVersionHelper.IsWindows11() is false ? SystemColors.WindowBrush : null;
_mainWindow.Background = OSVersionHelper.IsWindows11() is false ? SystemColors.WindowBrush : null;
_mainWindow.Resources.MergedDictionaries.Clear();
_mainWindow.Resources.MergedDictionaries.Add(new ResourceDictionary
@@ -66,7 +67,7 @@ namespace PowerLauncher.Helper
Source = new Uri(themeString, UriKind.Absolute),
};
_mainWindow.Resources.MergedDictionaries.Add(fluentThemeDictionary);
if (!Common.UI.OSVersionHelper.IsWindows11())
if (!OSVersionHelper.IsWindows11())
{
// Apply background only on Windows 10
// Windows theme does not work properly for dark and light mode so right now set the background color manual.
@@ -95,7 +96,7 @@ namespace PowerLauncher.Helper
{
Source = new Uri(styleThemeString, UriKind.Relative),
});
if (Common.UI.OSVersionHelper.IsWindows11())
if (OSVersionHelper.IsWindows11())
{
// Apply background only on Windows 11 to keep the same style as WPFUI
_mainWindow.Background = new SolidColorBrush

View File

@@ -15,6 +15,7 @@ using System.Windows.Interop;
using System.Windows.Media.Imaging;
using Common.UI;
using ManagedCommon;
using Microsoft.PowerLauncher.Telemetry;
using Microsoft.PowerToys.Telemetry;
using PowerLauncher.Helper;

View File

@@ -7,8 +7,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using Common.UI;
using ManagedCommon;
using Microsoft.Win32;
using Wox.Plugin.Common.VirtualDesktop.Interop;
using Wox.Plugin.Common.Win32;