From 402082b37647b8d5e1457b3d87d87ba8f96ddec7 Mon Sep 17 00:00:00 2001 From: Marterich <47688561+Marterich@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:00:34 +0200 Subject: [PATCH] Add hover effect for the app tiles --- config/themes.json | 2 ++ functions/public/Invoke-WPFUIApps.ps1 | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/config/themes.json b/config/themes.json index 04a1934b..1b7b8a65 100644 --- a/config/themes.json +++ b/config/themes.json @@ -39,6 +39,7 @@ }, "Light": { "AppInstallUnselectedColor": "#F0F0F0", + "AppInstallHighlightedColor": "#CFCFCF", "AppInstallSelectedColor": "#C2C2C2", "ComboBoxForegroundColor": "#232629", "ComboBoxBackgroundColor": "#F7F7F7", @@ -76,6 +77,7 @@ }, "Dark": { "AppInstallUnselectedColor": "#232629", + "AppInstallHighlightedColor": "#3C3C3C", "AppInstallSelectedColor": "#4C4C4C", "ComboBoxForegroundColor": "#F7F7F7", "ComboBoxBackgroundColor": "#1E3747", diff --git a/functions/public/Invoke-WPFUIApps.ps1 b/functions/public/Invoke-WPFUIApps.ps1 index 11bbe3e7..fa48f37e 100644 --- a/functions/public/Invoke-WPFUIApps.ps1 +++ b/functions/public/Invoke-WPFUIApps.ps1 @@ -314,6 +314,16 @@ function Invoke-WPFUIApps { $childCheckbox = ($this.Child.Children | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0] $childCheckBox.isChecked = -not $childCheckbox.IsChecked }) + $border.Add_MouseEnter({ + if (($sync.$($this.Tag).IsChecked) -eq $false){ + $this.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallHighlightedColor") + } + }) + $border.Add_MouseLeave({ + if (($sync.$($this.Tag).IsChecked) -eq $false){ + $this.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor") + } + }) # Create a DockPanel inside the Border $dockPanel = New-Object Windows.Controls.DockPanel $dockPanel.LastChildFill = $true