mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 10:32:35 -05:00
Remove Alphabetical List, Sort Apps inside Category Alphabetically
This commit is contained in:
@ -114,34 +114,20 @@ Invoke-WinutilThemeChange -init $true
|
||||
|
||||
$noimage = "https://images.emojiterra.com/google/noto-emoji/unicode-15/color/512px/1f4e6.png"
|
||||
$noimage = [Windows.Media.Imaging.BitmapImage]::new([Uri]::new($noimage))
|
||||
$sync.Buttons = @{}
|
||||
$SortedAppsHashtable = [ordered]@{}
|
||||
$sortedProperties = $sync.configs.applications.PSObject.Properties | Sort-Object { $_.Value.Content }
|
||||
$sortedProperties | ForEach-Object {
|
||||
$SortedAppsHashtable[$_.Name] = $_.Value
|
||||
|
||||
$sync.configs.applicationsHashtable = @{}
|
||||
$sync.configs.applications.PSObject.Properties | ForEach-Object {
|
||||
$sync.configs.applicationsHashtable[$_.Name] = $_.Value
|
||||
}
|
||||
|
||||
# Now call the function with the final merged config
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
|
||||
Invoke-WPFUIApps -Apps $SortedAppsHashtable -targetGridName "appspanel"
|
||||
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel"
|
||||
|
||||
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
|
||||
|
||||
$sync.SortbyCategory.Add_Checked({
|
||||
Write-Host "Sort By Category"
|
||||
$sync.Form.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
|
||||
Invoke-WPFUIApps -Apps $SortedAppsHashtable -targetGridName "appspanel"
|
||||
}) | Out-Null
|
||||
})
|
||||
$sync.SortbyAlphabet.Add_Checked({
|
||||
Write-Host "Sort By Alphabet"
|
||||
$sync.Form.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
|
||||
Invoke-WPFUIApps -Apps $SortedAppsHashtable -targetGridName "appspanel" -alphabetical $true
|
||||
})
|
||||
})
|
||||
|
||||
#===========================================================================
|
||||
# Store Form Objects In PowerShell
|
||||
#===========================================================================
|
||||
|
@ -37,11 +37,13 @@ $sync = [Hashtable]::Synchronized(@{})
|
||||
$sync.PSScriptRoot = $PSScriptRoot
|
||||
$sync.version = "#{replaceme}"
|
||||
$sync.configs = @{}
|
||||
$sync.Buttons = @{}
|
||||
$sync.ProcessRunning = $false
|
||||
$sync.selectedApps = [System.Collections.Generic.List[string]]::new()
|
||||
$sync.ShowOnlySeleced = $false
|
||||
$sync.currentTab = "Install"
|
||||
|
||||
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
|
||||
$argList = @()
|
||||
|
Reference in New Issue
Block a user