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",
"Categories": [
"Privacy & Suggested Content",
"System",
"Start Menu",
"AI",
"Windows Update",
"Taskbar",
"Appearance",
"File Explorer",
"Multi-tasking",
"Other",
"Gaming"
{
"Name": "Privacy & Suggested Content",
"Icon": ""
},
{
"Name": "System",
"Icon": ""
},
{
"Name": "Start Menu",
"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": [
{
@@ -20,10 +53,30 @@
"Category": "Taskbar",
"Priority": 2,
"Values": [
{ "Label": "Hide", "FeatureIds": ["HideSearchTb"] },
{ "Label": "Show search icon only", "FeatureIds": ["ShowSearchIconTb"] },
{ "Label": "Show search icon and label", "FeatureIds": ["ShowSearchLabelTb"] },
{ "Label": "Show search box", "FeatureIds": ["ShowSearchBoxTb"] }
{
"Label": "Hide",
"FeatureIds": [
"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",
"Category": "Taskbar",
"Values": [
{ "Label": "All taskbars", "FeatureIds": ["MMTaskbarModeAll"] },
{ "Label": "Main taskbar and taskbar where window is open", "FeatureIds": ["MMTaskbarModeMainActive"] },
{ "Label": "Taskbar where window is open", "FeatureIds": ["MMTaskbarModeActive"] }
{
"Label": "All taskbars",
"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",
"Category": "Taskbar",
"Values": [
{ "Label": "Always", "FeatureIds": ["CombineTaskbarAlways"] },
{ "Label": "When taskbar is full", "FeatureIds": ["CombineTaskbarWhenFull"] },
{ "Label": "Never", "FeatureIds": ["CombineTaskbarNever"] }
{
"Label": "Always",
"FeatureIds": [
"CombineTaskbarAlways"
]
},
{
"Label": "When taskbar is full",
"FeatureIds": [
"CombineTaskbarWhenFull"
]
},
{
"Label": "Never",
"FeatureIds": [
"CombineTaskbarNever"
]
}
]
},
{
@@ -51,9 +134,24 @@
"Label": "Combine taskbar buttons on secondary displays",
"Category": "Taskbar",
"Values": [
{ "Label": "Always", "FeatureIds": ["CombineMMTaskbarAlways"] },
{ "Label": "When taskbar is full", "FeatureIds": ["CombineMMTaskbarWhenFull"] },
{ "Label": "Never", "FeatureIds": ["CombineMMTaskbarNever"] }
{
"Label": "Always",
"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",
"Category": "Start Menu",
"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",
"Category": "File Explorer",
"Values": [
{ "Label": "Home", "FeatureIds": ["ExplorerToHome"] },
{ "Label": "This PC", "FeatureIds": ["ExplorerToThisPC"] },
{ "Label": "Downloads", "FeatureIds": ["ExplorerToDownloads"] },
{ "Label": "OneDrive", "FeatureIds": ["ExplorerToOneDrive"] }
{
"Label": "Home",
"FeatureIds": [
"ExplorerToHome"
]
},
{
"Label": "This PC",
"FeatureIds": [
"ExplorerToThisPC"
]
},
{
"Label": "Downloads",
"FeatureIds": [
"ExplorerToDownloads"
]
},
{
"Label": "OneDrive",
"FeatureIds": [
"ExplorerToOneDrive"
]
}
]
},
{
@@ -82,10 +210,30 @@
"Category": "Multi-tasking",
"Priority": 10,
"Values": [
{ "Label": "Don't show tabs", "FeatureIds": ["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"] }
{
"Label": "Don't show tabs",
"FeatureIds": [
"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"
]
}
]
}
],
@@ -1144,4 +1292,4 @@
"MaxVersion": null
}
]
}
}

View File

@@ -71,7 +71,7 @@
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4">
<TextBlock x:Name="Arrow"
Text="&#xE70D;"
FontFamily="Segoe MDL2 Assets"
FontFamily="Segoe Fluent Icons"
FontSize="10"
HorizontalAlignment="Right"
VerticalAlignment="Center"
@@ -246,17 +246,26 @@
<Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold"/>
<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}"/>
</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 -->
<Style x:Key="CategoryHelpLinkButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" 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="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False"/>
@@ -366,7 +375,7 @@
<ColumnDefinition Width="*"/>
</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">
<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>
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,2"/>
</Grid>
@@ -498,7 +507,7 @@
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="46"/>
<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="Template">
<Setter.Value>
@@ -802,7 +811,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</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"/>
<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>
@@ -873,7 +882,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</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"/>
<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>
@@ -970,7 +979,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</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"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
</Grid>
@@ -1013,7 +1022,7 @@
<!-- 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">
<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"/>
</StackPanel>
</Button>
@@ -1096,7 +1105,7 @@
</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">
<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"/>
</StackPanel>
</Button>
@@ -1105,7 +1114,7 @@
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<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>
</Button>
</StackPanel>

View File

@@ -1179,10 +1179,11 @@ function OpenGUI {
return "https://github.com/Raphire/Win11Debloat/wiki/Features#$slug"
}
function GetOrCreateCategoryCard($category) {
if (-not $category) { $category = 'Other' }
function GetOrCreateCategoryCard($categoryObj) {
$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
$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'
$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
$headerRow = New-Object System.Windows.Controls.StackPanel
$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.Text = $category
$header.Text = $categoryName
$header.Style = $window.Resources['CategoryHeaderTextBlock']
$headerRow.Children.Add($header) | Out-Null
@@ -1209,8 +1220,8 @@ function OpenGUI {
$helpBtn = New-Object System.Windows.Controls.Button
$helpBtn.Content = $helpIcon
$helpBtn.ToolTip = "Open wiki for more info on $category features"
$helpBtn.Tag = (GetWikiUrlForCategory -category $category)
$helpBtn.ToolTip = "Open wiki for more info on '$categoryName' tweaks"
$helpBtn.Tag = (GetWikiUrlForCategory -category $categoryName)
$helpBtn.Style = $window.Resources['CategoryHelpLinkButtonStyle']
$helpBtn.Add_Click({
param($sender, $e)
@@ -1223,7 +1234,7 @@ function OpenGUI {
$border.Child = $panel
$target.Children.Add($border) | Out-Null
$script:CategoryCardMap[$category] = $panel
$script:CategoryCardMap[$categoryName] = $panel
return $panel
}
@@ -1237,14 +1248,26 @@ function OpenGUI {
# Create cards in the order defined in Features.json Categories (if present)
$orderedCategories = @()
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 {
$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
$panel = GetOrCreateCategoryCard -category $category
$panel = GetOrCreateCategoryCard -categoryObj $categoryObj
if (-not $panel) { continue }
# Collect groups and features for this category, then sort by priority
@@ -1254,7 +1277,7 @@ function OpenGUI {
if ($featuresJson.UiGroups) {
$groupIndex = 0
foreach ($group in $featuresJson.UiGroups) {
if ($group.Category -ne $category) { $groupIndex++; continue }
if ($group.Category -ne $categoryName) { $groupIndex++; continue }
$categoryItems += [PSCustomObject]@{
Type = 'group'
Data = $group
@@ -1268,7 +1291,7 @@ function OpenGUI {
# Add individual features for this category
$featureIndex = 0
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
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))) {