From 3faa3bad3dead726b6fb1b7324753957373932d7 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sat, 26 Oct 2024 17:16:33 +0200 Subject: [PATCH] reorder buttons & fix Togglebutton toggling if action not possible - reorder getinstalled and clearselection - set togglebutton back if no app is selected --- config/appnavigation.json | 16 ++++++++-------- functions/public/Invoke-WPFUIApps.ps1 | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/appnavigation.json b/config/appnavigation.json index f1486143..b42942f9 100644 --- a/config/appnavigation.json +++ b/config/appnavigation.json @@ -13,20 +13,20 @@ "Order": "2", "Description": "Toggle between showing all or only the selected applications" }, - "WPFGetInstalled": { - "Content": "Get Installed", - "Category": "____Actions", - "Type": "Button", - "Order": "3", - "Description": "Show installed applications" - }, "WPFClearInstallSelection": { "Content": "Clear Selection", "Category": "____Actions", "Type": "Button", - "Order": "4", + "Order": "3", "Description": "Clear the selection of applications" }, + "WPFGetInstalled": { + "Content": "Get Installed", + "Category": "____Actions", + "Type": "Button", + "Order": "4", + "Description": "Show installed applications" + }, "WingetRadioButton": { "Content": "Winget", "Category": "__Package Manager", diff --git a/functions/public/Invoke-WPFUIApps.ps1 b/functions/public/Invoke-WPFUIApps.ps1 index d1aaa13c..11bbe3e7 100644 --- a/functions/public/Invoke-WPFUIApps.ps1 +++ b/functions/public/Invoke-WPFUIApps.ps1 @@ -89,6 +89,7 @@ function Show-OnlyCheckedApps { # If no apps are selected, do not allow switching to show only selected if (($false -eq $sync.ShowOnlySelected) -and ($appKeys.Count -eq 0)) { Write-Host "No apps selected" + $sync.wpfselectedfilter.IsChecked = $false return } $sync.ShowOnlySelected = -not $sync.ShowOnlySelected