From 4b741ce43045968a6b2fec5023a3490a7da68c2e Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 3 Sep 2024 21:41:16 +0200 Subject: [PATCH] fixes - use correct ctt blue color #0567ff - remove unneeded comments - rename Logoview to assets --- ...voke-WinUtilLogoviewbox.ps1 => Invoke-WinUtilAssets.ps1} | 6 +++--- functions/private/Set-WinUtilTaskbarItem.ps1 | 6 +++--- functions/private/Show-CustomDialog.ps1 | 2 +- scripts/main.ps1 | 5 +---- 4 files changed, 8 insertions(+), 11 deletions(-) rename functions/private/{Invoke-WinUtilLogoviewbox.ps1 => Invoke-WinUtilAssets.ps1} (97%) diff --git a/functions/private/Invoke-WinUtilLogoviewbox.ps1 b/functions/private/Invoke-WinUtilAssets.ps1 similarity index 97% rename from functions/private/Invoke-WinUtilLogoviewbox.ps1 rename to functions/private/Invoke-WinUtilAssets.ps1 index d9577812..6ea5afa3 100644 --- a/functions/private/Invoke-WinUtilLogoviewbox.ps1 +++ b/functions/private/Invoke-WinUtilAssets.ps1 @@ -1,4 +1,4 @@ -function Invoke-WinUtilLogoviewbox { +function Invoke-WinUtilAssets { param ( $type, $Size, @@ -38,7 +38,7 @@ C 18.00,14.00 45.00,27.74 45.00,27.74 "@ $LogoPath1 = New-Object Windows.Shapes.Path $LogoPath1.Data = [Windows.Media.Geometry]::Parse($LogoPathData1) - $LogoPath1.Fill = [Windows.Media.Brushes]::Blue + $LogoPath1.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#0567ff") $LogoPathData2 = @" M 107.00,14.00 @@ -54,7 +54,7 @@ C 109.01,19.06 108.93,30.37 104.66,34.21 "@ $LogoPath2 = New-Object Windows.Shapes.Path $LogoPath2.Data = [Windows.Media.Geometry]::Parse($LogoPathData2) - $LogoPath2.Fill = [Windows.Media.Brushes]::Blue + $LogoPath2.Fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#0567ff") $LogoPathData3 = @" M 20.00,46.00 diff --git a/functions/private/Set-WinUtilTaskbarItem.ps1 b/functions/private/Set-WinUtilTaskbarItem.ps1 index 145e9cd7..cfd72249 100644 --- a/functions/private/Set-WinUtilTaskbarItem.ps1 +++ b/functions/private/Set-WinUtilTaskbarItem.ps1 @@ -61,13 +61,13 @@ function Set-WinUtilTaskbaritem { if ($overlay) { switch ($overlay) { 'logo' { - $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilLogoviewbox -Type "Logo" -Size 80 -Render) + $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "Logo" -Size 80 -Render) } 'checkmark' { - $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilLogoviewbox -Type "checkmark" -Size 512 -Render) + $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "checkmark" -Size 512 -Render) } 'warning' { - $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilLogoviewbox -Type "warning" -Size 512 -Render) + $sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "warning" -Size 512 -Render) } 'None' { $sync["Form"].taskbarItemInfo.Overlay = $null diff --git a/functions/private/Show-CustomDialog.ps1 b/functions/private/Show-CustomDialog.ps1 index 1cc3b6b3..d2bbe089 100644 --- a/functions/private/Show-CustomDialog.ps1 +++ b/functions/private/Show-CustomDialog.ps1 @@ -129,7 +129,7 @@ function Show-CustomDialog { [Windows.Controls.Grid]::SetRow($stackPanel, 0) # Set the row to the second row (0-based index) # Add SVG path to the stack panel - $stackPanel.Children.Add((Invoke-WinUtilLogoviewbox -Type "logo" -Size 25)) + $stackPanel.Children.Add((Invoke-WinUtilAssets -Type "logo" -Size 25)) # Add "Winutil" text $winutilTextBlock = New-Object Windows.Controls.TextBlock diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 55261291..4334f087 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -446,7 +446,7 @@ $sync["Form"].Add_Loaded({ }) $NavLogoPanel = $sync["Form"].FindName("NavLogoPanel") -$NavLogoPanel.Children.Add((Invoke-WinUtilLogoviewbox -Type "logo" -Size 25)) | Out-Null +$NavLogoPanel.Children.Add((Invoke-WinUtilAssets -Type "logo" -Size 25)) | Out-Null # Initialize the hashtable $winutildir = @{} @@ -457,9 +457,6 @@ $winutildir["path"] = "$env:LOCALAPPDATA\winutil\" $winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico" -#$sync["Form"].Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($winutildir["logo.ico"]).ToBitmap() -#$sync["logo.svg"] = [System.Drawing.Bitmap]::FromStream([System.IO.MemoryStream]::new([System.Convert]::FromBase64String($sync["icon.svg"]))) - Set-WinUtilTaskbaritem -overlay "logo" $sync["Form"].Add_Activated({