Fix win10 icons by falling back to Segoe MDL2 Assets (#696)

This commit is contained in:
Jeffrey
2026-07-08 23:16:01 +02:00
committed by GitHub
parent e38aafe01e
commit 89a5d508d8
9 changed files with 59 additions and 47 deletions
+8 -1
View File
@@ -7,7 +7,8 @@
populates the window's Resources with SolidColorBrush entries keyed by
category and resource name (e.g. "AppAccentColor"). Additionally loads and
merges shared XAML styles from the script's SharedStylesSchema path if
available.
available. Also resolves the icon font: Segoe Fluent Icons on Windows 11
and Segoe MDL2 Assets on Windows 10.
.PARAMETER window
The WPF Window whose resource dictionary will be populated.
@@ -122,6 +123,12 @@ function SetWindowThemeResources {
}
}
# Segoe Fluent Icons ships only on Windows 11 (build >= 22000).
# On Windows 10, fall back to Segoe MDL2 Assets.
$winBuild = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
$iconFontName = if ($winBuild -ge 22000) { 'Segoe Fluent Icons' } else { 'Segoe MDL2 Assets' }
$window.Resources['AppIconFontFamily'] = [System.Windows.Media.FontFamily]::new($iconFontName)
# Load and merge shared styles
if ($script:SharedStylesSchema -and (Test-Path $script:SharedStylesSchema)) {
$sharedXaml = Get-Content -Path $script:SharedStylesSchema -Raw