Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions config/tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
6 changes: 5 additions & 1 deletion functions/public/Invoke-WPFUIElements.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
10 changes: 9 additions & 1 deletion pester/configs.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if ($statefulRegistry.Count -ne @($entry.Value.registry).Count) {
$invalidEntries.Add("$($entry.Name) registry states must all use Values")
} else {
Expand Down
6 changes: 4 additions & 2 deletions pester/multiplane-overlay.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 @("<RemoveEntry>", "5", "5")
$script:states[1].Values.PSObject.Properties.Value | Should -Be @("<RemoveEntry>", "<RemoveEntry>", "1")
}
Expand Down
Loading