From 9fed8d1c4c73eb28a76fa940d6beb4985778ab52 Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Fri, 3 Jul 2026 22:29:22 -0700 Subject: [PATCH] Reapply font scaling after theme change (#4782) --- functions/private/Invoke-WinUtilFontScaling.ps1 | 3 +++ functions/private/Invoke-WinutilThemeChange.ps1 | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/functions/private/Invoke-WinUtilFontScaling.ps1 b/functions/private/Invoke-WinUtilFontScaling.ps1 index 1a88094e..a238d4a5 100644 --- a/functions/private/Invoke-WinUtilFontScaling.ps1 +++ b/functions/private/Invoke-WinUtilFontScaling.ps1 @@ -74,6 +74,9 @@ function Invoke-WinUtilFontScaling { } } + # Store the scale factor so it can be reapplied after theme changes + $sync.FontScaleFactor = $ScaleFactor + # Update the font scaling percentage displayed on the UI if ($sync.FontScalingValue) { $percentage = [math]::Round($ScaleFactor * 100) diff --git a/functions/private/Invoke-WinutilThemeChange.ps1 b/functions/private/Invoke-WinutilThemeChange.ps1 index a3e9d177..adeba9fb 100644 --- a/functions/private/Invoke-WinutilThemeChange.ps1 +++ b/functions/private/Invoke-WinutilThemeChange.ps1 @@ -149,6 +149,11 @@ function Invoke-WinutilThemeChange { } } + # Reapply font scaling if it was previously set (theme change resets shared resources) + if ($sync.ContainsKey("FontScaleFactor") -and $sync.FontScaleFactor -ne 1.0) { + Invoke-WinUtilFontScaling -ScaleFactor $sync.FontScaleFactor + } + # Update the theme selector button with the appropriate icon $ThemeButton = $sync.Form.FindName("ThemeButton") $ThemeButton.Content = [string]$themeButtonIcon