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