mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-10-08 06:26:45 +00:00
Refactor app recommendation visuals to use shapes for improved clarity (#788)
This commit is contained in:
@@ -431,7 +431,7 @@ function Add-AppsToMainWindow {
|
||||
$checkbox.IsChecked = $app.IsChecked
|
||||
$checkbox.Style = $Window.Resources['AppsPanelCheckBoxStyle']
|
||||
|
||||
# Build table row: Recommendation dot | Name | Description | App ID
|
||||
# Build table row: Recommendation indicator | Name | Description | App ID
|
||||
$row = New-Object System.Windows.Controls.Grid
|
||||
$row.Style = $Window.Resources['AppTableRowStyle']
|
||||
$c0 = New-Object System.Windows.Controls.ColumnDefinition; $c0.Width = $Window.Resources['AppTableDotColWidth']
|
||||
@@ -441,16 +441,30 @@ function Add-AppsToMainWindow {
|
||||
$row.ColumnDefinitions.Add($c0); $row.ColumnDefinitions.Add($c1)
|
||||
$row.ColumnDefinitions.Add($c2); $row.ColumnDefinitions.Add($c3)
|
||||
|
||||
$dot = New-Object System.Windows.Shapes.Ellipse
|
||||
$dot.Style = $Window.Resources['AppRecommendationDotStyle']
|
||||
$dot.Fill = switch ($app.Recommendation) { 'safe' { $brushSafe } 'unsafe' { $brushUnsafe } default { $brushDefault } }
|
||||
$indicator = switch ($app.Recommendation) {
|
||||
'safe' { New-Object System.Windows.Shapes.Ellipse }
|
||||
'unsafe' {
|
||||
$triangle = New-Object System.Windows.Shapes.Polygon
|
||||
$triangle.Points = [System.Windows.Media.PointCollection]::Parse('0,9 4.5,0 9,9')
|
||||
$triangle.Stretch = 'Fill'
|
||||
$triangle
|
||||
}
|
||||
default {
|
||||
$diamond = New-Object System.Windows.Shapes.Polygon
|
||||
$diamond.Points = [System.Windows.Media.PointCollection]::Parse('4.5,0 9,4.5 4.5,9 0,4.5')
|
||||
$diamond.Stretch = 'Fill'
|
||||
$diamond
|
||||
}
|
||||
}
|
||||
$indicator.Style = $Window.Resources['AppRecommendationIndicatorStyle']
|
||||
$indicator.Fill = switch ($app.Recommendation) { 'safe' { $brushSafe } 'unsafe' { $brushUnsafe } default { $brushDefault } }
|
||||
$recommendationKey = switch ($app.Recommendation) {
|
||||
'safe' { 'AppLegendRecommendedTooltip' }
|
||||
'unsafe' { 'AppLegendNotRecommendedTooltip' }
|
||||
default { 'AppLegendOptionalTooltip' }
|
||||
}
|
||||
$dot.SetResourceReference([System.Windows.FrameworkElement]::ToolTipProperty, "Language_$recommendationKey")
|
||||
[System.Windows.Controls.Grid]::SetColumn($dot, 0)
|
||||
$indicator.SetResourceReference([System.Windows.FrameworkElement]::ToolTipProperty, "Language_$recommendationKey")
|
||||
[System.Windows.Controls.Grid]::SetColumn($indicator, 0)
|
||||
|
||||
$tbName = New-Object System.Windows.Controls.TextBlock
|
||||
$tbName.Text = $app.FriendlyName
|
||||
@@ -469,7 +483,7 @@ function Add-AppsToMainWindow {
|
||||
$tbId.ToolTip = $app.AppIdDisplay
|
||||
[System.Windows.Controls.Grid]::SetColumn($tbId, 3)
|
||||
|
||||
$row.Children.Add($dot) | Out-Null
|
||||
$row.Children.Add($indicator) | Out-Null
|
||||
$row.Children.Add($tbName) | Out-Null
|
||||
$row.Children.Add($tbDesc) | Out-Null
|
||||
$row.Children.Add($tbId) | Out-Null
|
||||
|
||||
Reference in New Issue
Block a user