@@ -60,6 +60,30 @@ function Initialize-InstallAppEntry {
6060 $borderElement.SetResourceReference ([Windows.Controls.Control ]::BackgroundProperty, " AppInstallUnselectedColor" )
6161 })
6262
63+ $contentPanel = New-Object Windows.Controls.StackPanel
64+ $contentPanel.Orientation = " Horizontal"
65+ $contentPanel.VerticalAlignment = [Windows.VerticalAlignment ]::Center
66+
67+ $icon = New-Object Windows.Controls.Grid
68+ $icon.SetResourceReference ([Windows.FrameworkElement ]::WidthProperty, " AppEntryIconSize" )
69+ $icon.SetResourceReference ([Windows.FrameworkElement ]::HeightProperty, " AppEntryIconSize" )
70+ $icon.Margin = New-Object Windows.Thickness(0 , 0 , 8 , 0 )
71+ $fallback = New-Object Windows.Controls.TextBlock
72+ $fallback.Text = $Apps .$appKey.content.TrimStart (" ." ).Substring(0 , 1 ).ToUpper()
73+ $fallback.FontWeight = " Bold" ; $fallback.HorizontalAlignment = " Center" ; $fallback.VerticalAlignment = " Center"
74+ if ($Apps .$appKey.link ) { $fallback.Visibility = " Collapsed" }
75+ $fallback.SetResourceReference ([Windows.Controls.TextBlock ]::FontSizeProperty, " AppEntryFontSize" )
76+ $fallback.SetResourceReference ([Windows.Controls.TextBlock ]::ForegroundProperty, " ToggleButtonOnColor" )
77+ [void ]$icon.Children.Add ($fallback )
78+ if ($Apps .$appKey.link ) {
79+ $logo = New-Object Windows.Controls.Image
80+ $logo.Stretch = [Windows.Media.Stretch ]::Uniform
81+ $logo.Source = " https://www.google.com/s2/favicons?sz=64&domain_url=$ ( [uri ]::EscapeDataString($Apps .$appKey.link )) "
82+ $logo.Add_ImageFailed ({ $this.Visibility = " Collapsed" ; $this.Parent.Children [0 ].Visibility = " Visible" })
83+ [void ]$icon.Children.Add ($logo )
84+ }
85+ [void ]$contentPanel.Children.Add ($icon )
86+
6387 # Create the TextBlock for the application name
6488 $appName = New-Object Windows.Controls.TextBlock
6589 $appName.Style = $sync.Form.Resources.AppEntryNameStyle
@@ -73,7 +97,8 @@ function Initialize-InstallAppEntry {
7397
7498 [void ]$appName.Inlines.Add ($fossRun )
7599 }
76- $checkBox.Content = $appName
100+ [void ]$contentPanel.Children.Add ($appName )
101+ $checkBox.Content = $contentPanel
77102
78103 # Add accessibility properties to make the elements screen reader friendly
79104 $checkBox.SetValue ([Windows.Automation.AutomationProperties ]::NameProperty, $app.content )
0 commit comments