From affedd3cabca8c1c22f3c74b21590b8341194da0 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Fri, 1 Nov 2024 21:18:16 +0100 Subject: [PATCH 1/4] [FEAT] change/add some icons - change settings & close icon to new one using "Segoe Fluent Icons" fontfamily - add icons to search context menu using "Segoe Fluent Icons" fontfamily --- config/themes.json | 2 +- xaml/inputXML.xaml | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/config/themes.json b/config/themes.json index 18f55b56..d3cc20ad 100644 --- a/config/themes.json +++ b/config/themes.json @@ -19,7 +19,7 @@ "IconFontSize": "14", "IconButtonSize": "35", "SettingsIconFontSize": "18", - "CloseIconFontSize": "18", + "CloseIconFontSize": "12", "MicroWinLogoSize": "10", "MicrowinCheckBoxMargin": "-10,5,0,0", "GroupBorderBackgroundColor": "#232629", diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index db6894f4..5374f0c5 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -617,9 +617,22 @@ - - - + + + + + + + + + + + + + + + + @@ -874,7 +887,7 @@ Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,0" - FontFamily="Segoe MDL2 Assets" + FontFamily="Segoe Fluent Icons" Content=""/> From 125e78be962c2fc8bcff12f9d47806967c9d5835 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sat, 2 Nov 2024 00:04:19 +0100 Subject: [PATCH 2/4] refractor PR - remove "Segoe Fluent Icons" changes - add Invoke-WPFGetIso improvements from #2731 > read image once, then take info from the result of that. --- config/themes.json | 2 +- functions/public/Invoke-WPFGetIso.ps1 | 30 ++++++++++++++++++++------- xaml/inputXML.xaml | 25 ++++++---------------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/config/themes.json b/config/themes.json index d3cc20ad..18f55b56 100644 --- a/config/themes.json +++ b/config/themes.json @@ -19,7 +19,7 @@ "IconFontSize": "14", "IconButtonSize": "35", "SettingsIconFontSize": "18", - "CloseIconFontSize": "12", + "CloseIconFontSize": "18", "MicroWinLogoSize": "10", "MicrowinCheckBoxMargin": "-10,5,0,0", "GroupBorderBackgroundColor": "#232629", diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index 954ee432..e43312ad 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -260,19 +260,33 @@ function Invoke-WPFGetIso { $wimFile = $wimFile.Replace(".wim", ".esd").Trim() } $sync.MicrowinWindowsFlavors.Items.Clear() - Get-WindowsImage -ImagePath $wimFile | ForEach-Object { + + # Store the results of Get-WindowsImage in a variable + $images = Get-WindowsImage -ImagePath $wimFile + + $proEditionIndex = -1 + $proeditionfound = $false + + # Populate the list of Windows flavors and find the Pro edition + $images | ForEach-Object { $imageIdx = $_.ImageIndex $imageName = $_.ImageName $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") - } - $sync.MicrowinWindowsFlavors.SelectedIndex = 0 - Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want." - Get-WindowsImage -ImagePath $wimFile | ForEach-Object { - if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") { - # We have found the Pro edition - $sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1 + + # Check if the image name contains 'Pro' + if ($imageName -like "*Pro*" -and !$proeditionfound) { + $proEditionIndex = $imageIdx + $proeditionfound = $true } } + + # Set the selected index to the Pro edition if found, otherwise default to the first item + if ($proEditionIndex -ne -1) { + $sync.MicrowinWindowsFlavors.SelectedIndex = $proEditionIndex - 1 + } else { + $sync.MicrowinWindowsFlavors.SelectedIndex = 0 + } + Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....." diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 5374f0c5..db6894f4 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -617,22 +617,9 @@ - - - - - - - - - - - - - - - - + + + @@ -887,7 +874,7 @@ Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,0" - FontFamily="Segoe Fluent Icons" + FontFamily="Segoe MDL2 Assets" Content=""/> From f3bffa9952c6c995fb7dea0b4a44fccfcfdf882b Mon Sep 17 00:00:00 2001 From: MyDrift Date: Wed, 6 Nov 2024 11:38:19 +0100 Subject: [PATCH 3/4] restore usage of EditionID TODO: fetch EditionID foreach index without looping Get-WindowsImage --- functions/public/Invoke-WPFGetIso.ps1 | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index e43312ad..dc706aa0 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -261,32 +261,21 @@ function Invoke-WPFGetIso { } $sync.MicrowinWindowsFlavors.Items.Clear() - # Store the results of Get-WindowsImage in a variable $images = Get-WindowsImage -ImagePath $wimFile - $proEditionIndex = -1 - $proeditionfound = $false - # Populate the list of Windows flavors and find the Pro edition $images | ForEach-Object { $imageIdx = $_.ImageIndex $imageName = $_.ImageName + $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") - # Check if the image name contains 'Pro' - if ($imageName -like "*Pro*" -and !$proeditionfound) { - $proEditionIndex = $imageIdx - $proeditionfound = $true + if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") { + # We have found the Pro edition + $sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1 } } - # Set the selected index to the Pro edition if found, otherwise default to the first item - if ($proEditionIndex -ne -1) { - $sync.MicrowinWindowsFlavors.SelectedIndex = $proEditionIndex - 1 - } else { - $sync.MicrowinWindowsFlavors.SelectedIndex = 0 - } - Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....." From b5c80bfbd2d27a663d2cb6400c14798d8340691c Mon Sep 17 00:00:00 2001 From: MyDrift Date: Wed, 6 Nov 2024 17:44:07 +0100 Subject: [PATCH 4/4] write info into shell for user Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com> --- functions/public/Invoke-WPFGetIso.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index dc706aa0..8a05648a 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -270,6 +270,9 @@ function Invoke-WPFGetIso { $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") + $sync.MicrowinWindowsFlavors.SelectedIndex = 0 + Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want." + if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") { # We have found the Pro edition $sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1