Skip to content

Commit

Permalink
Fix Whitespace when using Search
Browse files Browse the repository at this point in the history
  • Loading branch information
Marterich committed Oct 16, 2024
1 parent 9dd8913 commit 80a933d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions functions/public/Invoke-WPFUIApps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,21 @@ function Search-AppsByNameOrDescription {
}
else {
$ItemsControl.Items | ForEach-Object {
# Hide all CategoryWrapPanel and ToggleButton
$_.Visibility = [Windows.Visibility]::Collapsed
if ($_.Tag -like "CategoryWrapPanel_*") {
$_.Visibility = [Windows.Visibility]::Visible
# Search for Apps that match the search string
$_.Children | Foreach-Object {
if ($sync.configs.applicationsHashtable.$($_.Tag).Content -like "*$SearchString*") {
# Show the App and the parent CategoryWrapPanel
$_.Visibility = [Windows.Visibility]::Visible
$_.parent.Visibility = [Windows.Visibility]::Visible
}
else {
$_.Visibility = [Windows.Visibility]::Collapsed
}
}
}
else {
# Hide all Category Labels
$_.Visibility = [Windows.Visibility]::Collapsed
}
}
}
}
Expand Down Expand Up @@ -254,7 +253,6 @@ function Invoke-WPFUIApps {
$scrollViewer.HorizontalAlignment = 'Stretch'
$scrollViewer.VerticalAlignment = 'Stretch'
$scrollViewer.CanContentScroll = $true
$scrollViewer.Margin = 0

$itemsControl = New-Object Windows.Controls.ItemsControl
$itemsControl.HorizontalAlignment = 'Stretch'
Expand Down

0 comments on commit 80a933d

Please sign in to comment.