From 329753746a29323f229ca350c8b11bd88091f62c Mon Sep 17 00:00:00 2001 From: Vyas Devgna <141345367+vyas-devgna@users.noreply.github.com> Date: Mon, 29 Jun 2026 04:08:37 +0530 Subject: [PATCH] Improve install app card UI --- config/themes.json | 9 +++--- .../private/Initialize-InstallAppEntry.ps1 | 27 +++++++++++++++- xaml/inputXML.xaml | 31 +++---------------- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/config/themes.json b/config/themes.json index e739e0c44f..5dd27df05d 100644 --- a/config/themes.json +++ b/config/themes.json @@ -1,9 +1,10 @@ { "shared": { - "AppEntryWidth": "200", - "AppEntryFontSize": "11", - "AppEntryMargin": "1,0,1,0", - "AppEntryBorderThickness": "0", + "AppEntryWidth": "220", + "AppEntryFontSize": "13.2", + "AppEntryIconSize": "28", + "AppEntryMargin": "3", + "AppEntryBorderThickness": "1", "CustomDialogFontSize": "12", "CustomDialogFontSizeHeader": "14", "CustomDialogLogoSize": "25", diff --git a/functions/private/Initialize-InstallAppEntry.ps1 b/functions/private/Initialize-InstallAppEntry.ps1 index e17b2e7c72..8e87134080 100644 --- a/functions/private/Initialize-InstallAppEntry.ps1 +++ b/functions/private/Initialize-InstallAppEntry.ps1 @@ -58,6 +58,30 @@ function Initialize-InstallAppEntry { $borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor") }) + $contentPanel = New-Object Windows.Controls.StackPanel + $contentPanel.Orientation = "Horizontal" + $contentPanel.VerticalAlignment = [Windows.VerticalAlignment]::Center + + $icon = New-Object Windows.Controls.Grid + $icon.SetResourceReference([Windows.FrameworkElement]::WidthProperty, "AppEntryIconSize") + $icon.SetResourceReference([Windows.FrameworkElement]::HeightProperty, "AppEntryIconSize") + $icon.Margin = New-Object Windows.Thickness(0, 0, 8, 0) + $fallback = New-Object Windows.Controls.TextBlock + $fallback.Text = $Apps.$appKey.content.TrimStart(".").Substring(0, 1).ToUpper() + $fallback.FontWeight = "Bold"; $fallback.HorizontalAlignment = "Center"; $fallback.VerticalAlignment = "Center" + if ($Apps.$appKey.link) { $fallback.Visibility = "Collapsed" } + $fallback.SetResourceReference([Windows.Controls.TextBlock]::FontSizeProperty, "AppEntryFontSize") + $fallback.SetResourceReference([Windows.Controls.TextBlock]::ForegroundProperty, "ToggleButtonOnColor") + [void]$icon.Children.Add($fallback) + if ($Apps.$appKey.link) { + $logo = New-Object Windows.Controls.Image + $logo.Stretch = [Windows.Media.Stretch]::Uniform + $logo.Source = "https://www.google.com/s2/favicons?sz=64&domain_url=$([uri]::EscapeDataString($Apps.$appKey.link))" + $logo.Add_ImageFailed({ $this.Visibility = "Collapsed"; $this.Parent.Children[0].Visibility = "Visible" }) + [void]$icon.Children.Add($logo) + } + [void]$contentPanel.Children.Add($icon) + # Create the TextBlock for the application name $appName = New-Object Windows.Controls.TextBlock $appName.Style = $sync.Form.Resources.AppEntryNameStyle @@ -71,7 +95,8 @@ function Initialize-InstallAppEntry { [void]$appName.Inlines.Add($fossRun) } - $checkBox.Content = $appName + [void]$contentPanel.Children.Add($appName) + $checkBox.Content = $contentPanel # Add accessibility properties to make the elements screen reader friendly $checkBox.SetValue([Windows.Automation.AutomationProperties]::NameProperty, $Apps.$appKey.content) diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 8730fb0c0f..6449a4f962 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -85,8 +85,8 @@