mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
@ -29,4 +29,30 @@ function Invoke-WPFTab {
|
||||
}
|
||||
}
|
||||
$sync.currentTab = $sync.$tabNav.Items[$tabNumber].Header
|
||||
|
||||
# Always reset the filter for the current tab
|
||||
if ($sync.currentTab -eq "Install") {
|
||||
# Reset Install tab filter
|
||||
Find-AppsByNameOrDescription -SearchString ""
|
||||
} elseif ($sync.currentTab -eq "Tweaks") {
|
||||
# Reset Tweaks tab filter
|
||||
Find-TweaksByNameOrDescription -SearchString ""
|
||||
}
|
||||
|
||||
# Show search bar in Install and Tweaks tabs
|
||||
if ($tabNumber -eq 0 -or $tabNumber -eq 1) {
|
||||
$sync.SearchBar.Visibility = "Visible"
|
||||
$searchIcon = ($sync.Form.FindName("SearchBar").Parent.Children | Where-Object { $_ -is [System.Windows.Controls.TextBlock] -and $_.Text -eq [char]0xE721 })[0]
|
||||
if ($searchIcon) {
|
||||
$searchIcon.Visibility = "Visible"
|
||||
}
|
||||
} else {
|
||||
$sync.SearchBar.Visibility = "Collapsed"
|
||||
$searchIcon = ($sync.Form.FindName("SearchBar").Parent.Children | Where-Object { $_ -is [System.Windows.Controls.TextBlock] -and $_.Text -eq [char]0xE721 })[0]
|
||||
if ($searchIcon) {
|
||||
$searchIcon.Visibility = "Collapsed"
|
||||
}
|
||||
# Hide the clear button if it's visible
|
||||
$sync.SearchBarClearButton.Visibility = "Collapsed"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user