mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-11 02:21:16 +10:00
Fix WinOneShot ComboItems compatibility (#4957)
* Fix WinOneShot ComboItems compatibility * Align ComboItems validation with renderer
This commit is contained in:
+1
-5
@@ -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.",
|
||||
|
||||
@@ -271,7 +271,11 @@ function Invoke-WPFUIElements {
|
||||
[System.Windows.Automation.AutomationProperties]::SetName($comboBox, $entryInfo.Content)
|
||||
|
||||
$comboItems = if ($entryInfo.ComboItems -is [string]) {
|
||||
if ($entryInfo.ComboItems.Contains("|")) {
|
||||
$entryInfo.ComboItems -split "\|"
|
||||
} else {
|
||||
$entryInfo.ComboItems -split " "
|
||||
}
|
||||
} else {
|
||||
@($entryInfo.ComboItems)
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user