From 7b63feab826cd152dee4baadca61a95bd0531a43 Mon Sep 17 00:00:00 2001 From: Marterich <47688561+Marterich@users.noreply.github.com> Date: Wed, 19 Mar 2025 23:51:26 +0100 Subject: [PATCH] remove timers --- functions/public/Invoke-WPFUIApps.ps1 | 8 ++++---- scripts/main.ps1 | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/functions/public/Invoke-WPFUIApps.ps1 b/functions/public/Invoke-WPFUIApps.ps1 index 04f417c3..43fc7e4f 100644 --- a/functions/public/Invoke-WPFUIApps.ps1 +++ b/functions/public/Invoke-WPFUIApps.ps1 @@ -10,13 +10,13 @@ function Invoke-WPFUIApps { switch ($TargetGridName) { "appspanel" { $dockPanel = Initialize-InstallAppsMainElement -TargetGridName $TargetGridName - log_time_taken "Setup DockPanel for Apps" + $null = Initialize-InstallHeader -TargetElement $dockPanel - log_time_taken "Setup Header for Apps" + $sync.ItemsControl = Initialize-InstallAppArea -TargetElement $dockPanel - log_time_taken "Setup ItemsControl for Apps" + Initialize-InstallCategoryAppList -TargetElement $sync.ItemsControl -Apps $Apps - log_time_taken "UI Initialized" + } default { Write-Output "$TargetGridName not yet implemented" diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 76453d77..7b280cfc 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -77,7 +77,7 @@ if (-NOT ($readerOperationSuccessful)) { [System.GC]::Collect() exit 1 } -log_time_taken "Main.ps1 xaml loaded" + # Setup the Window to follow listen for windows Theme Change events and update the winutil theme # throttle logic needed, because windows seems to send more than one theme change event per change $lastThemeChangeTime = [datetime]::MinValue @@ -105,21 +105,21 @@ $sync.Form.Add_Loaded({ return 0 }) }) -log_time_taken "Main.ps1 theme change event setup" + Invoke-WinutilThemeChange -init $true # Load the configuration files $noimage = "https://images.emojiterra.com/google/noto-emoji/unicode-15/color/512px/1f4e6.png" $noimage = [Windows.Media.Imaging.BitmapImage]::new([Uri]::new($noimage)) -log_time_taken "Main.ps1 downloaded default image" + $sync.configs.applicationsHashtable = @{} $sync.configs.applications.PSObject.Properties | ForEach-Object { $sync.configs.applicationsHashtable[$_.Name] = $_.Value } -log_time_taken "Main.ps1 loaded applications" + # Now call the function with the final merged config Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1 -log_time_taken "Main.ps1 loaded appnavigation" + # Add logic to handle click to the ToggleView Button on the Install Tab $sync.WPFToggleView.Add_Click({ $sync.CompactView = -not $sync.CompactView @@ -129,11 +129,11 @@ $sync.WPFToggleView.Add_Click({ } }) Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel" -log_time_taken "Main.ps1 loaded appspanel" + Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2 -log_time_taken "Main.ps1 loaded tweakspanel" + Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2 -log_time_taken "Main.ps1 loaded featurespanel" + # Future implementation: Add Windows Version to updates panel #Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1