From 4aba74bc848df4787df503d0980e9ca932657b0e Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sun, 2 Mar 2025 10:03:26 +0100 Subject: [PATCH] replace app image with OEM Asset Character --- .../private/Initalize-InstallAppEntry.ps1 | 32 +++++++++---------- scripts/main.ps1 | 3 -- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/functions/private/Initalize-InstallAppEntry.ps1 b/functions/private/Initalize-InstallAppEntry.ps1 index 47268a18fa..c374a9aef8 100644 --- a/functions/private/Initalize-InstallAppEntry.ps1 +++ b/functions/private/Initalize-InstallAppEntry.ps1 @@ -70,22 +70,22 @@ function Initialize-InstallAppEntry { $imageAndNamePanel.Orientation = "Horizontal" $imageAndNamePanel.VerticalAlignment = "Center" - # Create the Image and set a placeholder - $image = New-Object Windows.Controls.Image - # $image.Name = "wpfapplogo" + $App.Name - $image.Width = 40 - $image.Height = 40 - $image.Margin = New-Object Windows.Thickness(0, 0, 10, 0) - $image.Source = $noimage # Ensure $noimage is defined in your script - - # Clip the image corners - $image.Clip = New-Object Windows.Media.RectangleGeometry - $image.Clip.Rect = New-Object Windows.Rect(0, 0, $image.Width, $image.Height) - $image.Clip.RadiusX = 5 - $image.Clip.RadiusY = 5 - $image.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility") - - $imageAndNamePanel.Children.Add($image) | Out-Null + # Create the icon TextBlock + $icon = New-Object Windows.Controls.TextBlock + $icon.Text = [char]0xE74C # OEM Icon + $icon.FontFamily = "Segoe MDL2 Assets" + $icon.FontSize = 40 + $icon.Width = 50 + $icon.Height = 50 + $icon.Margin = New-Object Windows.Thickness(10, 10, 10, 2) + $icon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor") + $icon.Background = "Transparent" + $icon.HorizontalAlignment = "Center" + $icon.VerticalAlignment = "Center" + $icon.TextAlignment = "Center" + $icon.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility") + + $imageAndNamePanel.Children.Add($icon) | Out-Null # Create the TextBlock for the application name $appName = New-Object Windows.Controls.TextBlock diff --git a/scripts/main.ps1 b/scripts/main.ps1 index fe12165ac0..5dcbb3ad25 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -109,9 +109,6 @@ $sync.Form.Add_Loaded({ Invoke-WinutilThemeChange -init $true # Load the configuration files -$noimage = "https://images.emojiterra.com/google/noto-emoji/unicode-15/color/512px/1f4e6.png" -$noimage = [Windows.Media.Imaging.BitmapImage]::new([Uri]::new($noimage)) - $sync.configs.applicationsHashtable = @{} $sync.configs.applications.PSObject.Properties | ForEach-Object { $sync.configs.applicationsHashtable[$_.Name] = $_.Value