Add tweak category icons (#471)

This commit is contained in:
Jeffrey
2026-02-15 16:59:25 +01:00
committed by GitHub
parent 687c089f2e
commit 95dc490b6e
3 changed files with 240 additions and 60 deletions

View File

@@ -1,17 +1,50 @@
{ {
"Version": "1.0", "Version": "1.0",
"Categories": [ "Categories": [
"Privacy & Suggested Content", {
"System", "Name": "Privacy & Suggested Content",
"Start Menu", "Icon": ""
"AI", },
"Windows Update", {
"Taskbar", "Name": "System",
"Appearance", "Icon": ""
"File Explorer", },
"Multi-tasking", {
"Other", "Name": "Start Menu",
"Gaming" "Icon": ""
},
{
"Name": "AI",
"Icon": ""
},
{
"Name": "Windows Update",
"Icon": ""
},
{
"Name": "Taskbar",
"Icon": ""
},
{
"Name": "Appearance",
"Icon": ""
},
{
"Name": "File Explorer",
"Icon": ""
},
{
"Name": "Multi-tasking",
"Icon": ""
},
{
"Name": "Other",
"Icon": ""
},
{
"Name": "Gaming",
"Icon": ""
}
], ],
"UiGroups": [ "UiGroups": [
{ {
@@ -20,10 +53,30 @@
"Category": "Taskbar", "Category": "Taskbar",
"Priority": 2, "Priority": 2,
"Values": [ "Values": [
{ "Label": "Hide", "FeatureIds": ["HideSearchTb"] }, {
{ "Label": "Show search icon only", "FeatureIds": ["ShowSearchIconTb"] }, "Label": "Hide",
{ "Label": "Show search icon and label", "FeatureIds": ["ShowSearchLabelTb"] }, "FeatureIds": [
{ "Label": "Show search box", "FeatureIds": ["ShowSearchBoxTb"] } "HideSearchTb"
]
},
{
"Label": "Show search icon only",
"FeatureIds": [
"ShowSearchIconTb"
]
},
{
"Label": "Show search icon and label",
"FeatureIds": [
"ShowSearchLabelTb"
]
},
{
"Label": "Show search box",
"FeatureIds": [
"ShowSearchBoxTb"
]
}
] ]
}, },
{ {
@@ -31,9 +84,24 @@
"Label": "Show taskbar apps on", "Label": "Show taskbar apps on",
"Category": "Taskbar", "Category": "Taskbar",
"Values": [ "Values": [
{ "Label": "All taskbars", "FeatureIds": ["MMTaskbarModeAll"] }, {
{ "Label": "Main taskbar and taskbar where window is open", "FeatureIds": ["MMTaskbarModeMainActive"] }, "Label": "All taskbars",
{ "Label": "Taskbar where window is open", "FeatureIds": ["MMTaskbarModeActive"] } "FeatureIds": [
"MMTaskbarModeAll"
]
},
{
"Label": "Main taskbar and taskbar where window is open",
"FeatureIds": [
"MMTaskbarModeMainActive"
]
},
{
"Label": "Taskbar where window is open",
"FeatureIds": [
"MMTaskbarModeActive"
]
}
] ]
}, },
{ {
@@ -41,9 +109,24 @@
"Label": "Combine taskbar buttons on the main display", "Label": "Combine taskbar buttons on the main display",
"Category": "Taskbar", "Category": "Taskbar",
"Values": [ "Values": [
{ "Label": "Always", "FeatureIds": ["CombineTaskbarAlways"] }, {
{ "Label": "When taskbar is full", "FeatureIds": ["CombineTaskbarWhenFull"] }, "Label": "Always",
{ "Label": "Never", "FeatureIds": ["CombineTaskbarNever"] } "FeatureIds": [
"CombineTaskbarAlways"
]
},
{
"Label": "When taskbar is full",
"FeatureIds": [
"CombineTaskbarWhenFull"
]
},
{
"Label": "Never",
"FeatureIds": [
"CombineTaskbarNever"
]
}
] ]
}, },
{ {
@@ -51,9 +134,24 @@
"Label": "Combine taskbar buttons on secondary displays", "Label": "Combine taskbar buttons on secondary displays",
"Category": "Taskbar", "Category": "Taskbar",
"Values": [ "Values": [
{ "Label": "Always", "FeatureIds": ["CombineMMTaskbarAlways"] }, {
{ "Label": "When taskbar is full", "FeatureIds": ["CombineMMTaskbarWhenFull"] }, "Label": "Always",
{ "Label": "Never", "FeatureIds": ["CombineMMTaskbarNever"] } "FeatureIds": [
"CombineMMTaskbarAlways"
]
},
{
"Label": "When taskbar is full",
"FeatureIds": [
"CombineMMTaskbarWhenFull"
]
},
{
"Label": "Never",
"FeatureIds": [
"CombineMMTaskbarNever"
]
}
] ]
}, },
{ {
@@ -61,8 +159,18 @@
"Label": "Remove pinned apps from the start menu", "Label": "Remove pinned apps from the start menu",
"Category": "Start Menu", "Category": "Start Menu",
"Values": [ "Values": [
{ "Label": "Remove for the current user", "FeatureIds": ["ClearStart"] }, {
{ "Label": "Remove for all users", "FeatureIds": ["ClearStartAllUsers"] } "Label": "Remove for the current user",
"FeatureIds": [
"ClearStart"
]
},
{
"Label": "Remove for all users",
"FeatureIds": [
"ClearStartAllUsers"
]
}
] ]
}, },
{ {
@@ -70,10 +178,30 @@
"Label": "Open File Explorer to", "Label": "Open File Explorer to",
"Category": "File Explorer", "Category": "File Explorer",
"Values": [ "Values": [
{ "Label": "Home", "FeatureIds": ["ExplorerToHome"] }, {
{ "Label": "This PC", "FeatureIds": ["ExplorerToThisPC"] }, "Label": "Home",
{ "Label": "Downloads", "FeatureIds": ["ExplorerToDownloads"] }, "FeatureIds": [
{ "Label": "OneDrive", "FeatureIds": ["ExplorerToOneDrive"] } "ExplorerToHome"
]
},
{
"Label": "This PC",
"FeatureIds": [
"ExplorerToThisPC"
]
},
{
"Label": "Downloads",
"FeatureIds": [
"ExplorerToDownloads"
]
},
{
"Label": "OneDrive",
"FeatureIds": [
"ExplorerToOneDrive"
]
}
] ]
}, },
{ {
@@ -82,10 +210,30 @@
"Category": "Multi-tasking", "Category": "Multi-tasking",
"Priority": 10, "Priority": 10,
"Values": [ "Values": [
{ "Label": "Don't show tabs", "FeatureIds": ["HideTabsInAltTab"] }, {
{ "Label": "Show 3 most recent tabs", "FeatureIds": ["Show3TabsInAltTab"] }, "Label": "Don't show tabs",
{ "Label": "Show 5 most recent tabs", "FeatureIds": ["Show5TabsInAltTab"] }, "FeatureIds": [
{ "Label": "Show 20 most recent tabs", "FeatureIds": ["Show20TabsInAltTab"] } "HideTabsInAltTab"
]
},
{
"Label": "Show 3 most recent tabs",
"FeatureIds": [
"Show3TabsInAltTab"
]
},
{
"Label": "Show 5 most recent tabs",
"FeatureIds": [
"Show5TabsInAltTab"
]
},
{
"Label": "Show 20 most recent tabs",
"FeatureIds": [
"Show20TabsInAltTab"
]
}
] ]
} }
], ],

View File

@@ -71,7 +71,7 @@
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4"> <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4">
<TextBlock x:Name="Arrow" <TextBlock x:Name="Arrow"
Text="&#xE70D;" Text="&#xE70D;"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe Fluent Icons"
FontSize="10" FontSize="10"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -246,17 +246,26 @@
<Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock"> <Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="16"/> <Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="0,0,0,10"/> <Setter Property="Margin" Value="0,0,0,13"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/> <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
</Style> </Style>
<!-- Category header icon style -->
<Style x:Key="CategoryHeaderIcon" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
<Setter Property="FontSize" Value="19"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="Margin" Value="0,0,8,12"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<!-- Category help link button/text styles --> <!-- Category help link button/text styles -->
<Style x:Key="CategoryHelpLinkButtonStyle" TargetType="Button"> <Style x:Key="CategoryHelpLinkButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="6,1,0,10"/> <Setter Property="Margin" Value="6,1,0,13"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Focusable" Value="False"/> <Setter Property="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False"/> <Setter Property="IsTabStop" Value="False"/>
@@ -366,7 +375,7 @@
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border x:Name="CheckBoxBorder" Grid.Column="0" Width="18" Height="18" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0"> <Border x:Name="CheckBoxBorder" Grid.Column="0" Width="18" Height="18" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0">
<TextBlock x:Name="CheckMark" Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="12" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/> <TextBlock x:Name="CheckMark" Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="12" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
</Border> </Border>
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,2"/> <ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,2"/>
</Grid> </Grid>
@@ -498,7 +507,7 @@
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="46"/> <Setter Property="Width" Value="46"/>
<Setter Property="Height" Value="32"/> <Setter Property="Height" Value="32"/>
<Setter Property="FontFamily" Value="Segoe MDL2 Assets"/> <Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
<Setter Property="FontSize" Value="10"/> <Setter Property="FontSize" Value="10"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
@@ -802,7 +811,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/> <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="AppSearchPlaceholder" Grid.Column="1" Text="Search app" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/> <TextBlock x:Name="AppSearchPlaceholder" Grid.Column="1" Text="Search app" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" AutomationProperties.Name="Search app"/> <TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" AutomationProperties.Name="Search app"/>
</Grid> </Grid>
@@ -873,7 +882,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/> <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="1" Text="Search setting" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/> <TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="1" Text="Search setting" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="TweakSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/> <TextBox x:Name="TweakSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/>
</Grid> </Grid>
@@ -970,7 +979,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/> <TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/> <TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/> <TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
</Grid> </Grid>
@@ -1013,7 +1022,7 @@
<!-- Apply Changes Button --> <!-- Apply Changes Button -->
<Button x:Name="OverviewApplyBtn" Style="{StaticResource PrimaryButtonStyle}" Width="190" Height="44" Margin="0,0,0,15" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes"> <Button x:Name="OverviewApplyBtn" Style="{StaticResource PrimaryButtonStyle}" Width="190" Height="44" Margin="0,0,0,15" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/> <TextBlock Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/> <TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
</StackPanel> </StackPanel>
</Button> </Button>
@@ -1096,7 +1105,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{StaticResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Previous"> <Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{StaticResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Previous">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE72B;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/> <TextBlock Text="&#xE72B;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
<TextBlock Text="Previous" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/> <TextBlock Text="Previous" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
</StackPanel> </StackPanel>
</Button> </Button>
@@ -1105,7 +1114,7 @@
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource PrimaryButtonStyle}" AutomationProperties.Name="Next"> <Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/> <TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
<TextBlock Text="&#xE72A;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/> <TextBlock Text="&#xE72A;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
</Button> </Button>
</StackPanel> </StackPanel>

View File

@@ -1179,10 +1179,11 @@ function OpenGUI {
return "https://github.com/Raphire/Win11Debloat/wiki/Features#$slug" return "https://github.com/Raphire/Win11Debloat/wiki/Features#$slug"
} }
function GetOrCreateCategoryCard($category) { function GetOrCreateCategoryCard($categoryObj) {
if (-not $category) { $category = 'Other' } $categoryName = $categoryObj.Name
$categoryIcon = $categoryObj.Icon
if ($script:CategoryCardMap.ContainsKey($category)) { return $script:CategoryCardMap[$category] } if ($script:CategoryCardMap.ContainsKey($categoryName)) { return $script:CategoryCardMap[$categoryName] }
# Create a new card Border + StackPanel and add to shortest column # Create a new card Border + StackPanel and add to shortest column
$target = $columns | Sort-Object @{Expression={$_.Children.Count}; Ascending=$true}, @{Expression={$columns.IndexOf($_)}; Ascending=$true} | Select-Object -First 1 $target = $columns | Sort-Object @{Expression={$_.Children.Count}; Ascending=$true}, @{Expression={$columns.IndexOf($_)}; Ascending=$true} | Select-Object -First 1
@@ -1192,14 +1193,24 @@ function OpenGUI {
$border.Tag = 'DynamicCategory' $border.Tag = 'DynamicCategory'
$panel = New-Object System.Windows.Controls.StackPanel $panel = New-Object System.Windows.Controls.StackPanel
$safe = ($category -replace '[^a-zA-Z0-9_]','_') $safe = ($categoryName -replace '[^a-zA-Z0-9_]','_')
$panel.Name = "Category_{0}_Panel" -f $safe $panel.Name = "Category_{0}_Panel" -f $safe
$headerRow = New-Object System.Windows.Controls.StackPanel $headerRow = New-Object System.Windows.Controls.StackPanel
$headerRow.Orientation = 'Horizontal' $headerRow.Orientation = 'Horizontal'
# Add category icon
$icon = New-Object System.Windows.Controls.TextBlock
# Convert HTML entity to character (e.g., &#xE72E; -> actual character)
if ($categoryIcon -match '&#x([0-9A-Fa-f]+);') {
$hexValue = [Convert]::ToInt32($matches[1], 16)
$icon.Text = [char]$hexValue
}
$icon.Style = $window.Resources['CategoryHeaderIcon']
$headerRow.Children.Add($icon) | Out-Null
$header = New-Object System.Windows.Controls.TextBlock $header = New-Object System.Windows.Controls.TextBlock
$header.Text = $category $header.Text = $categoryName
$header.Style = $window.Resources['CategoryHeaderTextBlock'] $header.Style = $window.Resources['CategoryHeaderTextBlock']
$headerRow.Children.Add($header) | Out-Null $headerRow.Children.Add($header) | Out-Null
@@ -1209,8 +1220,8 @@ function OpenGUI {
$helpBtn = New-Object System.Windows.Controls.Button $helpBtn = New-Object System.Windows.Controls.Button
$helpBtn.Content = $helpIcon $helpBtn.Content = $helpIcon
$helpBtn.ToolTip = "Open wiki for more info on $category features" $helpBtn.ToolTip = "Open wiki for more info on '$categoryName' tweaks"
$helpBtn.Tag = (GetWikiUrlForCategory -category $category) $helpBtn.Tag = (GetWikiUrlForCategory -category $categoryName)
$helpBtn.Style = $window.Resources['CategoryHelpLinkButtonStyle'] $helpBtn.Style = $window.Resources['CategoryHelpLinkButtonStyle']
$helpBtn.Add_Click({ $helpBtn.Add_Click({
param($sender, $e) param($sender, $e)
@@ -1223,7 +1234,7 @@ function OpenGUI {
$border.Child = $panel $border.Child = $panel
$target.Children.Add($border) | Out-Null $target.Children.Add($border) | Out-Null
$script:CategoryCardMap[$category] = $panel $script:CategoryCardMap[$categoryName] = $panel
return $panel return $panel
} }
@@ -1237,14 +1248,26 @@ function OpenGUI {
# Create cards in the order defined in Features.json Categories (if present) # Create cards in the order defined in Features.json Categories (if present)
$orderedCategories = @() $orderedCategories = @()
if ($featuresJson.Categories) { if ($featuresJson.Categories) {
foreach ($c in $featuresJson.Categories) { if ($categoriesPresent.ContainsKey($c)) { $orderedCategories += $c } } foreach ($c in $featuresJson.Categories) {
$categoryName = if ($c -is [string]) { $c } else { $c.Name }
if ($categoriesPresent.ContainsKey($categoryName)) {
# Store the full category object (or create one with default icon for string categories)
$categoryObj = if ($c -is [string]) { @{Name = $c; Icon = '&#xE712;'} } else { $c }
$orderedCategories += $categoryObj
}
}
} else { } else {
$orderedCategories = $categoriesPresent.Keys # For backward compatibility, create category objects from keys
foreach ($catName in $categoriesPresent.Keys) {
$orderedCategories += @{Name = $catName; Icon = '&#xE712;'}
}
} }
foreach ($category in $orderedCategories) { foreach ($categoryObj in $orderedCategories) {
$categoryName = $categoryObj.Name
# Create/get card for this category # Create/get card for this category
$panel = GetOrCreateCategoryCard -category $category $panel = GetOrCreateCategoryCard -categoryObj $categoryObj
if (-not $panel) { continue } if (-not $panel) { continue }
# Collect groups and features for this category, then sort by priority # Collect groups and features for this category, then sort by priority
@@ -1254,7 +1277,7 @@ function OpenGUI {
if ($featuresJson.UiGroups) { if ($featuresJson.UiGroups) {
$groupIndex = 0 $groupIndex = 0
foreach ($group in $featuresJson.UiGroups) { foreach ($group in $featuresJson.UiGroups) {
if ($group.Category -ne $category) { $groupIndex++; continue } if ($group.Category -ne $categoryName) { $groupIndex++; continue }
$categoryItems += [PSCustomObject]@{ $categoryItems += [PSCustomObject]@{
Type = 'group' Type = 'group'
Data = $group Data = $group
@@ -1268,7 +1291,7 @@ function OpenGUI {
# Add individual features for this category # Add individual features for this category
$featureIndex = 0 $featureIndex = 0
foreach ($feature in $featuresJson.Features) { foreach ($feature in $featuresJson.Features) {
if ($feature.Category -ne $category) { $featureIndex++; continue } if ($feature.Category -ne $categoryName) { $featureIndex++; continue }
# Check version and feature compatibility using Features.json # Check version and feature compatibility using Features.json
if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) { if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) {