mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
filter out unneeded categories
This commit is contained in:
parent
3f48c8aa70
commit
4c6990b515
@ -87,7 +87,6 @@ function Invoke-WPFUIElements {
|
|||||||
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
|
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
|
||||||
if ($targetGridName -eq "appspanel") {
|
if ($targetGridName -eq "appspanel") {
|
||||||
$panelcount = 0
|
$panelcount = 0
|
||||||
$paneltotal = $columncount # Use columncount for even distribution
|
|
||||||
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
|
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
|
||||||
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
|
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
|
||||||
}
|
}
|
||||||
@ -139,7 +138,6 @@ function Invoke-WPFUIElements {
|
|||||||
$stackPanel.Children.Add($label) | Out-Null
|
$stackPanel.Children.Add($label) | Out-Null
|
||||||
|
|
||||||
$sync[$category] = $label
|
$sync[$category] = $label
|
||||||
write-host $sync[$category]
|
|
||||||
|
|
||||||
# Sort entries by Order and then by Name, but only display Name
|
# Sort entries by Order and then by Name, but only display Name
|
||||||
$entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
|
$entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
|
||||||
|
@ -410,6 +410,19 @@ $sync["SearchBar"].Add_TextChanged({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$activeCategories = $activeApplications | Select-Object -ExpandProperty category -Unique
|
||||||
|
|
||||||
|
foreach ($category in $activeCategories) {
|
||||||
|
$sync[$category].Visibility = "Visible"
|
||||||
|
}
|
||||||
|
if ($activeCategories) {
|
||||||
|
$inactiveCategories = Compare-Object -ReferenceObject $allCategories -DifferenceObject $activeCategories -PassThru
|
||||||
|
} else {
|
||||||
|
$inactiveCategories = $allCategories
|
||||||
|
}
|
||||||
|
foreach ($category in $inactiveCategories) {
|
||||||
|
$sync[$category].Visibility = "Collapsed"}
|
||||||
})
|
})
|
||||||
|
|
||||||
# Initialize the hashtable
|
# Initialize the hashtable
|
||||||
|
Loading…
Reference in New Issue
Block a user