diff --git a/config/tweaks.json b/config/tweaks.json index 1987c15e..75b5c6ff 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1465,11 +1465,7 @@ "category": "Customize Preferences", "panel": "2", "Type": "Combobox", - "ComboItems": [ - "Enabled", - "Disabled (Compatibility)", - "Fully Disabled" - ], + "ComboItems": "Enabled|Disabled (Compatibility)|Fully Disabled", "ComboDescriptions": { "Enabled": "Uses Windows' default overlay behavior.", "Disabled (Compatibility)": "Disables MPO using OverlayTestMode=5, the less aggressive compatibility method.", diff --git a/functions/public/Invoke-WPFUIElements.ps1 b/functions/public/Invoke-WPFUIElements.ps1 index 29629942..f3b2d717 100644 --- a/functions/public/Invoke-WPFUIElements.ps1 +++ b/functions/public/Invoke-WPFUIElements.ps1 @@ -271,7 +271,11 @@ function Invoke-WPFUIElements { [System.Windows.Automation.AutomationProperties]::SetName($comboBox, $entryInfo.Content) $comboItems = if ($entryInfo.ComboItems -is [string]) { - $entryInfo.ComboItems -split " " + if ($entryInfo.ComboItems.Contains("|")) { + $entryInfo.ComboItems -split "\|" + } else { + $entryInfo.ComboItems -split " " + } } else { @($entryInfo.ComboItems) } diff --git a/pester/configs.Tests.ps1 b/pester/configs.Tests.ps1 index 9f0705b6..cc1d7897 100644 --- a/pester/configs.Tests.ps1 +++ b/pester/configs.Tests.ps1 @@ -439,7 +439,15 @@ Describe "UI-rendered config entries" { } $statefulRegistry = @($entry.Value.registry | Where-Object Values) if ($statefulRegistry.Count -gt 0) { - $comboItems = @($entry.Value.ComboItems) + $comboItems = if ($entry.Value.ComboItems -is [string]) { + if ($entry.Value.ComboItems.Contains("|")) { + @($entry.Value.ComboItems -split "\|") + } else { + @($entry.Value.ComboItems -split " ") + } + } else { + @($entry.Value.ComboItems) + } if ($statefulRegistry.Count -ne @($entry.Value.registry).Count) { $invalidEntries.Add("$($entry.Name) registry states must all use Values") } else { diff --git a/pester/multiplane-overlay.Tests.ps1 b/pester/multiplane-overlay.Tests.ps1 index dee7b900..54483aa1 100644 --- a/pester/multiplane-overlay.Tests.ps1 +++ b/pester/multiplane-overlay.Tests.ps1 @@ -18,9 +18,11 @@ BeforeAll { Describe "Multiplane Overlay configuration" { It "keeps every state and registry action in tweaks.json" { $script:config.WPFMultiplaneOverlay.Type | Should -Be "Combobox" - $script:config.WPFMultiplaneOverlay.ComboItems | Should -Be @("Enabled", "Disabled (Compatibility)", "Fully Disabled") + $script:config.WPFMultiplaneOverlay.ComboItems | Should -BeOfType [string] + $comboItems = @($script:config.WPFMultiplaneOverlay.ComboItems -split "\|") + $comboItems | Should -Be @("Enabled", "Disabled (Compatibility)", "Fully Disabled") $script:states.Count | Should -Be 2 - $script:states[0].Values.PSObject.Properties.Name | Should -Be $script:config.WPFMultiplaneOverlay.ComboItems + $script:states[0].Values.PSObject.Properties.Name | Should -Be $comboItems $script:states[0].Values.PSObject.Properties.Value | Should -Be @("", "5", "5") $script:states[1].Values.PSObject.Properties.Value | Should -Be @("", "", "1") }