Reapply font scaling after theme change (#4782)

This commit is contained in:
Gabi
2026-07-03 22:29:22 -07:00
committed by GitHub
parent 4ae3549b8a
commit 9fed8d1c4c
2 changed files with 8 additions and 0 deletions

View File

@@ -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)

View File

@@ -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