Compare commits

..

3 Commits

8 changed files with 168 additions and 254 deletions

View File

@ -527,6 +527,14 @@
"link": "https://espanso.org/", "link": "https://espanso.org/",
"winget": "Espanso.Espanso" "winget": "Espanso.Espanso"
}, },
"etcher": {
"category": "Utilities",
"choco": "etcher",
"content": "Etcher USB Creator",
"description": "Etcher is a powerful tool for creating bootable USB drives with ease.",
"link": "https://www.balena.io/etcher/",
"winget": "Balena.Etcher"
},
"falkon": { "falkon": {
"category": "Browsers", "category": "Browsers",
"choco": "falkon", "choco": "falkon",

View File

@ -2,7 +2,6 @@
"Standard": [ "Standard": [
"WPFTweaksAH", "WPFTweaksAH",
"WPFTweaksConsumerFeatures", "WPFTweaksConsumerFeatures",
"WPFTweaksDisableExplorerAutoDiscovery",
"WPFTweaksDVR", "WPFTweaksDVR",
"WPFTweaksHiber", "WPFTweaksHiber",
"WPFTweaksHome", "WPFTweaksHome",
@ -19,7 +18,6 @@
], ],
"Minimal": [ "Minimal": [
"WPFTweaksConsumerFeatures", "WPFTweaksConsumerFeatures",
"WPFTweaksDisableExplorerAutoDiscovery",
"WPFTweaksHome", "WPFTweaksHome",
"WPFTweaksServices", "WPFTweaksServices",
"WPFTweaksTele" "WPFTweaksTele"

View File

@ -35,8 +35,7 @@
"CheckboxMouseOverColor": "#999999", "CheckboxMouseOverColor": "#999999",
"ButtonBorderThickness": "1", "ButtonBorderThickness": "1",
"ButtonMargin": "1", "ButtonMargin": "1",
"ButtonCornerRadius": "2", "ButtonCornerRadius": "2"
"AppTileImageSize": "40"
}, },
"Light": { "Light": {
"AppInstallUnselectedColor": "#F0F0F0", "AppInstallUnselectedColor": "#F0F0F0",

View File

@ -3758,60 +3758,5 @@
"Type": "Button", "Type": "Button",
"ButtonWidth": "300", "ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf" "link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
}, }
"WPFTweaksDisableExplorerAutoDiscovery": {
"Content": "Disable Explorer Automatic Folder Discovery",
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience.",
"category": "Essential Tweaks",
"panel": "1",
"Order": "a005_",
"InvokeScript": [
"
# Previously detected folders
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
Remove-Item -Path $bagMRU -Recurse -Force
Write-Host \"Removed $bagMRU\"
# Every folder
$allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
if (!(Test-Path $allFolders)) {
New-Item -Path $allFolders -Force
Write-Host \"Created $allFolders\"
}
# Generic view
New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
Write-Host \"Set FolderType to NotSpecified\"
Write-Host Please sign out and back in, or restart your computer to apply the changes!
"
],
"UndoScript": [
"
# Previously detected folders
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
Remove-Item -Path $bagMRU -Recurse -Force
Write-Host \"Removed $bagMRU\"
Write-Host Please sign out and back in, or restart your computer to apply the changes!
"
],
},
} }

View File

@ -5,23 +5,28 @@ function Initialize-InstallAppEntry {
Used to as part of the Install Tab UI generation Used to as part of the Install Tab UI generation
.PARAMETER TargetElement .PARAMETER TargetElement
The Element into which the Apps should be placed The Element into which the Apps should be placed
.PARAMETER appKey .PARAMETER AppKey
The Key of the app inside the $sync.configs.applicationsHashtable The Key of the app inside the $sync.configs.applicationsHashtable
#> #>
param( param(
[Windows.Controls.WrapPanel]$TargetElement, [Windows.Controls.WrapPanel]$TargetElement,
$appKey $AppKey
) )
$App = $sync.configs.applicationsHashtable.$AppKey
# Create the outer Border for the application type # Create the outer Border for the application type
$border = New-Object Windows.Controls.Border $border = New-Object Windows.Controls.Border
$border.Style = $sync.Form.Resources.AppTileBorderStyle $border.BorderBrush = [Windows.Media.Brushes]::Gray
$border.Tag = $appKey $border.SetResourceReference([Windows.Controls.Control]::BorderThicknessProperty, "AppTileBorderThickness")
$border.ToolTip = $Apps.$appKey.description $border.CornerRadius = 5
$border.SetResourceReference([Windows.Controls.Control]::PaddingProperty, "AppTileMargins")
$border.SetResourceReference([Windows.Controls.Control]::WidthProperty, "AppTileWidth")
$border.VerticalAlignment = "Top"
$border.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$border.Cursor = [System.Windows.Input.Cursors]::Hand
$border.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
$border.Tag = $Appkey
$border.ToolTip = $App.description
$border.Add_MouseUp({ $border.Add_MouseUp({
if ($_.ChangedButton -eq [System.Windows.Input.MouseButton]::Right) {
Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*";
}
$childCheckbox = ($this.Child.Children | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0] $childCheckbox = ($this.Child.Children | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0]
$childCheckBox.isChecked = -not $childCheckbox.IsChecked $childCheckBox.isChecked = -not $childCheckbox.IsChecked
}) })
@ -42,8 +47,12 @@ function Initialize-InstallAppEntry {
# Create the CheckBox, vertically centered # Create the CheckBox, vertically centered
$checkBox = New-Object Windows.Controls.CheckBox $checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $appKey $checkBox.Name = $AppKey
$checkbox.Style = $sync.Form.Resources.AppTileCheckboxStyle $checkBox.Background = "Transparent"
$checkBox.HorizontalAlignment = "Left"
$checkBox.VerticalAlignment = "Center"
$checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$checkBox.SetResourceReference([Windows.Controls.Control]::StyleProperty, "CollapsedCheckBoxStyle")
$checkbox.Add_Checked({ $checkbox.Add_Checked({
Invoke-WPFSelectedAppsUpdate -type "Add" -checkbox $this Invoke-WPFSelectedAppsUpdate -type "Add" -checkbox $this
$borderElement = $this.Parent.Parent $borderElement = $this.Parent.Parent
@ -55,7 +64,7 @@ function Initialize-InstallAppEntry {
$borderElement = $this.Parent.Parent $borderElement = $this.Parent.Parent
$borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor") $borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
}) })
$sync.$($checkBox.Name) = $checkBox
# Create a StackPanel for the image and name # Create a StackPanel for the image and name
$imageAndNamePanel = New-Object Windows.Controls.StackPanel $imageAndNamePanel = New-Object Windows.Controls.StackPanel
$imageAndNamePanel.Orientation = "Horizontal" $imageAndNamePanel.Orientation = "Horizontal"
@ -64,15 +73,29 @@ function Initialize-InstallAppEntry {
# Create the Image and set a placeholder # Create the Image and set a placeholder
$image = New-Object Windows.Controls.Image $image = New-Object Windows.Controls.Image
# $image.Name = "wpfapplogo" + $App.Name # $image.Name = "wpfapplogo" + $App.Name
$image.Style = $sync.Form.Resources.AppTileImageStyle $image.Width = 40
$image.Height = 40
$image.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
$image.Source = $noimage # Ensure $noimage is defined in your script $image.Source = $noimage # Ensure $noimage is defined in your script
# Clip the image corners
$image.Clip = New-Object Windows.Media.RectangleGeometry
$image.Clip.Rect = New-Object Windows.Rect(0, 0, $image.Width, $image.Height)
$image.Clip.RadiusX = 5
$image.Clip.RadiusY = 5
$image.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility")
$imageAndNamePanel.Children.Add($image) | Out-Null $imageAndNamePanel.Children.Add($image) | Out-Null
# Create the TextBlock for the application name # Create the TextBlock for the application name
$appName = New-Object Windows.Controls.TextBlock $appName = New-Object Windows.Controls.TextBlock
$appName.Style = $sync.Form.Resources.AppTileNameStyle $appName.Text = $App.Content
$appName.Text = $Apps.$appKey.content $appName.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "AppTileFontSize")
$appName.FontWeight = [Windows.FontWeights]::Bold
$appName.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$appName.VerticalAlignment = "Center"
$appName.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$appName.Background = "Transparent"
$imageAndNamePanel.Children.Add($appName) | Out-Null $imageAndNamePanel.Children.Add($appName) | Out-Null
# Add the image and name panel to the Checkbox # Add the image and name panel to the Checkbox
@ -84,53 +107,91 @@ function Initialize-InstallAppEntry {
# Create the StackPanel for the buttons and dock it to the right # Create the StackPanel for the buttons and dock it to the right
$buttonPanel = New-Object Windows.Controls.StackPanel $buttonPanel = New-Object Windows.Controls.StackPanel
$buttonPanel.Style = $sync.Form.Resources.AppTileButtonPanelStyle $buttonPanel.Orientation = "Horizontal"
$buttonPanel.HorizontalAlignment = "Right"
$buttonPanel.VerticalAlignment = "Center"
$buttonPanel.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$buttonPanel.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility")
[Windows.Controls.DockPanel]::SetDock($buttonPanel, [Windows.Controls.Dock]::Right) [Windows.Controls.DockPanel]::SetDock($buttonPanel, [Windows.Controls.Dock]::Right)
# Define the button properties # Create the "Install" button
$buttons = @( $installButton = New-Object Windows.Controls.Button
[PSCustomObject]@{ Name = "Install"; Description = "Install or Upgrade the application"; Tooltip = "Install or Upgrade the application"; Icon = [char]0xE118 }, $installButton.Width = 45
[PSCustomObject]@{ Name = "Uninstall"; Description = "Uninstall the application"; Tooltip = "Uninstall the application"; Icon = [char]0xE74D }, $installButton.Height = 35
[PSCustomObject]@{ Name = "Info"; Description = "Open the application's website in your default browser"; Tooltip = "Open the application's website in your default browser"; Icon = [char]0xE946 } $installButton.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
)
# Iterate over each button and create it $installIcon = New-Object Windows.Controls.TextBlock
foreach ($button in $buttons) { $installIcon.Text = [char]0xE118 # Install Icon
$newButton = New-Object Windows.Controls.Button $installIcon.FontFamily = "Segoe MDL2 Assets"
$newButton.Style = $sync.Form.Resources.AppTileButtonStyle $installIcon.FontSize = 20
$newButton.Content = $button.Icon $installIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$newButton.ToolTip = $button.Tooltip $installIcon.Background = "Transparent"
$buttonPanel.Children.Add($newButton) | Out-Null $installIcon.HorizontalAlignment = "Center"
$installIcon.VerticalAlignment = "Center"
switch ($button.Name) { $installButton.Content = $installIcon
"Install" { $installButton.ToolTip = "Install or Upgrade the application"
$newButton.Add_Click({ $buttonPanel.Children.Add($installButton) | Out-Null
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey # Add Click event for the "Install" button
Invoke-WPFInstall -PackagesToInstall $appObject $installButton.Add_Click({
}) $appKey = $this.Parent.Parent.Parent.Tag
} $appObject = $sync.configs.applicationsHashtable.$appKey
"Uninstall" { Invoke-WPFInstall -PackagesToInstall $appObject
$newButton.Add_Click({ })
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey # Create the "Uninstall" button
Invoke-WPFUnInstall -PackagesToUninstall $appObject $uninstallButton = New-Object Windows.Controls.Button
}) $uninstallButton.Width = 45
} $uninstallButton.Height = 35
"Info" {
$newButton.Add_Click({ $uninstallIcon = New-Object Windows.Controls.TextBlock
$appKey = $this.Parent.Parent.Parent.Tag $uninstallIcon.Text = [char]0xE74D # Uninstall Icon
$appObject = $sync.configs.applicationsHashtable.$appKey $uninstallIcon.FontFamily = "Segoe MDL2 Assets"
Start-Process $appObject.link $uninstallIcon.FontSize = 20
}) $uninstallIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
} $uninstallIcon.Background = "Transparent"
} $uninstallIcon.HorizontalAlignment = "Center"
} $uninstallIcon.VerticalAlignment = "Center"
$uninstallButton.Content = $uninstallIcon
$buttonPanel.Children.Add($uninstallButton) | Out-Null
$uninstallButton.ToolTip = "Uninstall the application"
$uninstallButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey
Invoke-WPFUnInstall -PackagesToUninstall $appObject
})
# Create the "Info" button
$infoButton = New-Object Windows.Controls.Button
$infoButton.Width = 45
$infoButton.Height = 35
$infoButton.Margin = New-Object Windows.Thickness(10, 0, 0, 0)
$infoIcon = New-Object Windows.Controls.TextBlock
$infoIcon.Text = [char]0xE946 # Info Icon
$infoIcon.FontFamily = "Segoe MDL2 Assets"
$infoIcon.FontSize = 20
$infoIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$infoIcon.Background = "Transparent"
$infoIcon.HorizontalAlignment = "Center"
$infoIcon.VerticalAlignment = "Center"
$infoButton.Content = $infoIcon
$infoButton.ToolTip = "Open the application's website in your default browser"
$buttonPanel.Children.Add($infoButton) | Out-Null
$infoButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey
Start-Process $appObject.link
})
# Add the button panel to the DockPanel # Add the button panel to the DockPanel
$dockPanel.Children.Add($buttonPanel) | Out-Null $dockPanel.Children.Add($buttonPanel) | Out-Null
# Add the border to the corresponding Category # Add the border to the corresponding Category
$TargetElement.Children.Add($border) | Out-Null $TargetElement.Children.Add($border) | Out-Null
return $checkbox
} }

View File

@ -53,17 +53,8 @@ function Initialize-InstallCategoryAppList {
$TargetElement.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ $TargetElement.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
$TargetElement.Items.Clear() # Remove the loading message $TargetElement.Items.Clear() # Remove the loading message
$categories = $Apps.Values | Select-Object -ExpandProperty category -Unique | Sort-Object
# Pre-group apps by category foreach ($category in $categories) {
$appsByCategory = @{}
foreach ($appKey in $Apps.Keys) {
$category = $Apps.$appKey.Category
if (-not $appsByCategory.ContainsKey($category)) {
$appsByCategory[$category] = @()
}
$appsByCategory[$category] += $appKey
}
foreach ($category in $($appsByCategory.Keys | Sort-Object)) {
Add-Category -Category $category -TargetElement $TargetElement Add-Category -Category $category -TargetElement $TargetElement
$wrapPanel = New-Object Windows.Controls.WrapPanel $wrapPanel = New-Object Windows.Controls.WrapPanel
$wrapPanel.Orientation = "Horizontal" $wrapPanel.Orientation = "Horizontal"
@ -73,9 +64,9 @@ function Initialize-InstallCategoryAppList {
$wrapPanel.Visibility = [Windows.Visibility]::Collapsed $wrapPanel.Visibility = [Windows.Visibility]::Collapsed
$wrapPanel.Tag = "CategoryWrapPanel_$category" $wrapPanel.Tag = "CategoryWrapPanel_$category"
$null = $TargetElement.Items.Add($wrapPanel) $null = $TargetElement.Items.Add($wrapPanel)
$appsByCategory[$category] | ForEach-Object { $Apps.Keys | Where-Object { $Apps.$_.Category -eq $category } | Sort-Object | ForEach-Object {
$sync.$_ = $(Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_) Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_
}
} }
} })
})
} }

View File

@ -46,6 +46,7 @@ class GenericException : Exception {
GenericException($Message) : base($Message) {} GenericException($Message) : base($Message) {}
} }
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window' $inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') [void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
@ -118,7 +119,6 @@ $sync.configs.applications.PSObject.Properties | ForEach-Object {
# Now call the function with the final merged config # Now call the function with the final merged config
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1 Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
# Add logic to handle click to the ToggleView Button on the Install Tab # Add logic to handle click to the ToggleView Button on the Install Tab
$sync.WPFToggleView.Add_Click({ $sync.WPFToggleView.Add_Click({
$sync.CompactView = -not $sync.CompactView $sync.CompactView = -not $sync.CompactView
@ -130,9 +130,7 @@ $sync.WPFToggleView.Add_Click({
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -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.tweaks -targetGridName "tweakspanel" -columncount 2
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2 Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
# Future implementation: Add Windows Version to updates panel # Future implementation: Add Windows Version to updates panel
#Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1 #Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1
@ -252,51 +250,34 @@ $sync.SearchBarClearButton.Add_Click({
# add some shortcuts for people that don't like clicking # add some shortcuts for people that don't like clicking
$commonKeyEvents = { $commonKeyEvents = {
# Prevent shortcuts from executing if a process is already running
if ($sync.ProcessRunning -eq $true) { if ($sync.ProcessRunning -eq $true) {
return return
} }
if ($_.Key -eq "Escape") { # Handle key presses of single keys
$sync.SearchBar.SelectAll() switch ($_.Key) {
$sync.SearchBar.Text = "" "Escape" { $sync.SearchBar.Text = "" }
$sync.SearchBarClearButton.Visibility = "Collapsed"
return
}
# don't ask, I know what I'm doing, just go...
if (($_.Key -eq "Q" -and $_.KeyboardDevice.Modifiers -eq "Ctrl")) {
$this.Close()
} }
# Handle Alt key combinations for navigation
if ($_.KeyboardDevice.Modifiers -eq "Alt") { if ($_.KeyboardDevice.Modifiers -eq "Alt") {
if ($_.SystemKey -eq "I") { $keyEventArgs = $_
Invoke-WPFButton "WPFTab1BT" switch ($_.SystemKey) {
} "I" { Invoke-WPFButton "WPFTab1BT"; $keyEventArgs.Handled = $true } # Navigate to Install tab and suppress Windows Warning Sound
if ($_.SystemKey -eq "T") { "T" { Invoke-WPFButton "WPFTab2BT"; $keyEventArgs.Handled = $true } # Navigate to Tweaks tab
Invoke-WPFButton "WPFTab2BT" "C" { Invoke-WPFButton "WPFTab3BT"; $keyEventArgs.Handled = $true } # Navigate to Config tab
} "U" { Invoke-WPFButton "WPFTab4BT"; $keyEventArgs.Handled = $true } # Navigate to Updates tab
if ($_.SystemKey -eq "C") { "M" { Invoke-WPFButton "WPFTab5BT"; $keyEventArgs.Handled = $true } # Navigate to MicroWin tab
Invoke-WPFButton "WPFTab3BT"
}
if ($_.SystemKey -eq "U") {
Invoke-WPFButton "WPFTab4BT"
}
if ($_.SystemKey -eq "M") {
Invoke-WPFButton "WPFTab5BT"
}
if ($_.SystemKey -eq "P") {
Write-Host "Your Windows Product Key: $((Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey)"
} }
} }
# shortcut for the filter box # Handle Ctrl key combinations for specific actions
if ($_.Key -eq "F" -and $_.KeyboardDevice.Modifiers -eq "Ctrl") { if ($_.KeyboardDevice.Modifiers -eq "Ctrl") {
if ($sync.SearchBar.Text -eq "Ctrl-F to filter") { switch ($_.Key) {
$sync.SearchBar.SelectAll() "F" { $sync.SearchBar.Focus() } # Focus on the search bar
$sync.SearchBar.Text = "" "Q" { $this.Close() } # Close the application
} }
$sync.SearchBar.Focus()
} }
} }
$sync["Form"].Add_PreViewKeyDown($commonKeyEvents) $sync["Form"].Add_PreViewKeyDown($commonKeyEvents)
$sync["Form"].Add_MouseLeftButtonDown({ $sync["Form"].Add_MouseLeftButtonDown({
@ -305,8 +286,8 @@ $sync["Form"].Add_MouseLeftButtonDown({
}) })
$sync["Form"].Add_MouseDoubleClick({ $sync["Form"].Add_MouseDoubleClick({
if ($_.OriginalSource.Name -eq "NavDockPanel" -or if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or
$_.OriginalSource.Name -eq "GridBesideNavDockPanel") { $_.OriginalSource -is [System.Windows.Controls.StackPanel]) {
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) { if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) {
$sync["Form"].WindowState = [Windows.WindowState]::Maximized $sync["Form"].WindowState = [Windows.WindowState]::Maximized
} }
@ -510,44 +491,36 @@ $sync["Form"].Add_Activated({
$sync["ThemeButton"].Add_Click({ $sync["ThemeButton"].Add_Click({
Write-Debug "ThemeButton clicked" Write-Debug "ThemeButton clicked"
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle" } Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle" }
$_.Handled = $false
}) })
$sync["AutoThemeMenuItem"].Add_Click({ $sync["AutoThemeMenuItem"].Add_Click({
Write-Debug "About clicked" Write-Debug "About clicked"
Invoke-WPFPopup -Action "Hide" -Popups @("Theme") Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
Invoke-WinutilThemeChange -theme "Auto" Invoke-WinutilThemeChange -theme "Auto"
$_.Handled = $false
}) })
$sync["DarkThemeMenuItem"].Add_Click({ $sync["DarkThemeMenuItem"].Add_Click({
Write-Debug "Dark Theme clicked" Write-Debug "Dark Theme clicked"
Invoke-WPFPopup -Action "Hide" -Popups @("Theme") Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
Invoke-WinutilThemeChange -theme "Dark" Invoke-WinutilThemeChange -theme "Dark"
$_.Handled = $false
}) })
$sync["LightThemeMenuItem"].Add_Click({ $sync["LightThemeMenuItem"].Add_Click({
Write-Debug "Light Theme clicked" Write-Debug "Light Theme clicked"
Invoke-WPFPopup -Action "Hide" -Popups @("Theme") Invoke-WPFPopup -Action "Hide" -Popups @("Theme")
Invoke-WinutilThemeChange -theme "Light" Invoke-WinutilThemeChange -theme "Light"
$_.Handled = $false
}) })
$sync["SettingsButton"].Add_Click({ $sync["SettingsButton"].Add_Click({
Write-Debug "SettingsButton clicked" Write-Debug "SettingsButton clicked"
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide" } Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide" }
$_.Handled = $false
}) })
$sync["ImportMenuItem"].Add_Click({ $sync["ImportMenuItem"].Add_Click({
Write-Debug "Import clicked" Write-Debug "Import clicked"
Invoke-WPFPopup -Action "Hide" -Popups @("Settings") Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
Invoke-WPFImpex -type "import" Invoke-WPFImpex -type "import"
$_.Handled = $false
}) })
$sync["ExportMenuItem"].Add_Click({ $sync["ExportMenuItem"].Add_Click({
Write-Debug "Export clicked" Write-Debug "Export clicked"
Invoke-WPFPopup -Action "Hide" -Popups @("Settings") Invoke-WPFPopup -Action "Hide" -Popups @("Settings")
Invoke-WPFImpex -type "export" Invoke-WPFImpex -type "export"
$_.Handled = $false
}) })
$sync["AboutMenuItem"].Add_Click({ $sync["AboutMenuItem"].Add_Click({
Write-Debug "About clicked" Write-Debug "About clicked"
@ -581,5 +554,7 @@ $sync["SponsorMenuItem"].Add_Click({
Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true
}) })
$sync["Form"].ShowDialog() | out-null $sync["Form"].ShowDialog() | out-null
Stop-Transcript Stop-Transcript

View File

@ -67,82 +67,6 @@
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="AppTileBorderStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="{DynamicResource AppTileBorderThickness}"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Padding" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Width" Value="{DynamicResource AppTileWidth}"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Background" Value="{DynamicResource AppInstallUnselectedColor}"/>
</Style>
<Style x:Key="AppTileCheckboxStyle" TargetType="CheckBox">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<ContentPresenter Content="{TemplateBinding Content}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="AppTileImageStyle" TargetType="Image">
<Setter Property="Width" Value="{DynamicResource AppTileImageSize}"/>
<Setter Property="Height" Value="{DynamicResource AppTileImageSize}"/>
<Setter Property="Margin">
<Setter.Value>
<Thickness Left="0" Top="0" Right="10" Bottom="0"/>
</Setter.Value>
</Setter>
<Setter Property="Clip">
<Setter.Value>
<RectangleGeometry Rect="0,0,40,40" RadiusX="5" RadiusY="5"/>
</Setter.Value>
</Setter>
<Setter Property="Visibility" Value="{DynamicResource AppTileCompactVisibility}"/>
</Style>
<Style x:Key="AppTileNameStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource AppTileFontSize}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style x:Key="AppTileButtonPanelStyle" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Visibility" Value="{DynamicResource AppTileCompactVisibility}"/>
</Style>
<Style x:Key="AppTileButtonStyle" TargetType="Button">
<Setter Property="Width" Value="45"/>
<Setter Property="Height" Value="35"/>
<Setter Property="Margin" Value="0,0,10,0"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundColor}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" FontFamily="Segoe MDL2 Assets" FontSize="20"
Foreground="{DynamicResource MainForegroundColor}"
Background="Transparent" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="HoverButtonStyle"> <Style TargetType="Button" x:Key="HoverButtonStyle">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" /> <Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
@ -578,6 +502,19 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<!-- Collapsed Checkbox Style -->
<Style x:Key="CollapsedCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<ContentPresenter Content="{TemplateBinding Content}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton"> <Style TargetType="RadioButton">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/> <Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/> <Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
@ -914,7 +851,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel Name="NavDockPanel" HorizontalAlignment="Stretch" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Row="0" Width="Auto"> <DockPanel HorizontalAlignment="Stretch" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Row="0" Width="Auto">
<StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0"> <StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0">
</StackPanel> </StackPanel>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}" <ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
@ -957,7 +894,7 @@
</TextBlock> </TextBlock>
</ToggleButton.Content> </ToggleButton.Content>
</ToggleButton> </ToggleButton>
<Grid Name="GridBesideNavDockPanel" Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch"> <Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <!-- Main content area --> <ColumnDefinition Width="*"/> <!-- Main content area -->
<ColumnDefinition Width="Auto"/><!-- Space for options button --> <ColumnDefinition Width="Auto"/><!-- Space for options button -->