mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-06 14:48:31 +00:00
Hightlight FOSS Apps (#4065)
* add foss tag functionality * update applications * update * update * fix * update * update * fix formatting
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -72,5 +72,13 @@
|
|||||||
"Type": "Button",
|
"Type": "Button",
|
||||||
"Order": "5",
|
"Order": "5",
|
||||||
"Description": "Show the selected applications"
|
"Description": "Show the selected applications"
|
||||||
|
},
|
||||||
|
"WPFToggleFOSSHighlight": {
|
||||||
|
"Content": "Highlight FOSS",
|
||||||
|
"Category": "__Selection",
|
||||||
|
"Type": "Toggle",
|
||||||
|
"Checked": true,
|
||||||
|
"Order": "6",
|
||||||
|
"Description": "Toggle the green highlight for FOSS applications"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,10 @@ function Initialize-InstallAppEntry {
|
|||||||
})
|
})
|
||||||
|
|
||||||
$checkBox = New-Object Windows.Controls.CheckBox
|
$checkBox = New-Object Windows.Controls.CheckBox
|
||||||
$checkBox.Name = $appKey
|
# Sanitize the name for WPF
|
||||||
|
$checkBox.Name = $appKey -replace '-', '_'
|
||||||
|
# Store the original appKey in Tag
|
||||||
|
$checkBox.Tag = $appKey
|
||||||
$checkbox.Style = $sync.Form.Resources.AppEntryCheckboxStyle
|
$checkbox.Style = $sync.Form.Resources.AppEntryCheckboxStyle
|
||||||
$checkbox.Add_Checked({
|
$checkbox.Add_Checked({
|
||||||
Invoke-WPFSelectedCheckboxesUpdate -type "Add" -checkboxName $this.Parent.Tag
|
Invoke-WPFSelectedCheckboxesUpdate -type "Add" -checkboxName $this.Parent.Tag
|
||||||
@@ -60,6 +63,12 @@ function Initialize-InstallAppEntry {
|
|||||||
$appName.Style = $sync.Form.Resources.AppEntryNameStyle
|
$appName.Style = $sync.Form.Resources.AppEntryNameStyle
|
||||||
$appName.Text = $Apps.$appKey.content
|
$appName.Text = $Apps.$appKey.content
|
||||||
|
|
||||||
|
# Change color to Green if FOSS
|
||||||
|
if ($Apps.$appKey.foss -eq $true) {
|
||||||
|
$appName.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "FOSSColor")
|
||||||
|
$appName.FontWeight = "Bold"
|
||||||
|
}
|
||||||
|
|
||||||
# Add the name to the Checkbox
|
# Add the name to the Checkbox
|
||||||
$checkBox.Content = $appName
|
$checkBox.Content = $appName
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,18 @@ function Invoke-WinutilThemeChange {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set FOSS Highlight Color
|
||||||
|
$fossEnabled = $true
|
||||||
|
if ($sync.WPFToggleFOSSHighlight) {
|
||||||
|
$fossEnabled = $sync.WPFToggleFOSSHighlight.IsChecked
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fossEnabled) {
|
||||||
|
$sync.Form.Resources["FOSSColor"] = [Windows.Media.SolidColorBrush]::new([Windows.Media.Color]::FromRgb(76, 175, 80)) # #4CAF50
|
||||||
|
} else {
|
||||||
|
$sync.Form.Resources["FOSSColor"] = $sync.Form.Resources["MainForegroundColor"]
|
||||||
|
}
|
||||||
|
|
||||||
# Update the theme selector button with the appropriate icon
|
# Update the theme selector button with the appropriate icon
|
||||||
$ThemeButton = $sync.Form.FindName("ThemeButton")
|
$ThemeButton = $sync.Form.FindName("ThemeButton")
|
||||||
$ThemeButton.Content = [string]$themeButtonIcon
|
$ThemeButton.Content = [string]$themeButtonIcon
|
||||||
|
|||||||
@@ -63,5 +63,12 @@ function Invoke-WPFButton {
|
|||||||
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
||||||
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
||||||
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
||||||
|
"WPFToggleFOSSHighlight" {
|
||||||
|
if ($sync.WPFToggleFOSSHighlight.IsChecked) {
|
||||||
|
$sync.Form.Resources["FOSSColor"] = [Windows.Media.SolidColorBrush]::new([Windows.Media.Color]::FromRgb(76, 175, 80)) # #4CAF50
|
||||||
|
} else {
|
||||||
|
$sync.Form.Resources["FOSSColor"] = $sync.Form.Resources["MainForegroundColor"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,18 @@ function Invoke-WPFUIElements {
|
|||||||
$itemsControl.Items.Add($dockPanel) | Out-Null
|
$itemsControl.Items.Add($dockPanel) | Out-Null
|
||||||
|
|
||||||
$sync[$entryInfo.Name] = $checkBox
|
$sync[$entryInfo.Name] = $checkBox
|
||||||
|
if ($entryInfo.Name -eq "WPFToggleFOSSHighlight") {
|
||||||
|
if ($entryInfo.Checked -eq $true) {
|
||||||
|
$sync[$entryInfo.Name].IsChecked = $true
|
||||||
|
}
|
||||||
|
|
||||||
|
$sync[$entryInfo.Name].Add_Checked({
|
||||||
|
Invoke-WPFButton -Button "WPFToggleFOSSHighlight"
|
||||||
|
})
|
||||||
|
$sync[$entryInfo.Name].Add_Unchecked({
|
||||||
|
Invoke-WPFButton -Button "WPFToggleFOSSHighlight"
|
||||||
|
})
|
||||||
|
} else {
|
||||||
$sync[$entryInfo.Name].IsChecked = (Get-WinUtilToggleStatus $entryInfo.Name)
|
$sync[$entryInfo.Name].IsChecked = (Get-WinUtilToggleStatus $entryInfo.Name)
|
||||||
|
|
||||||
$sync[$entryInfo.Name].Add_Checked({
|
$sync[$entryInfo.Name].Add_Checked({
|
||||||
@@ -191,6 +202,7 @@ function Invoke-WPFUIElements {
|
|||||||
Invoke-WinUtiltweaks $Sender.name -undo $true
|
Invoke-WinUtiltweaks $Sender.name -undo $true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"ToggleButton" {
|
"ToggleButton" {
|
||||||
$toggleButton = New-Object Windows.Controls.Primitives.ToggleButton
|
$toggleButton = New-Object Windows.Controls.Primitives.ToggleButton
|
||||||
|
|||||||
Reference in New Issue
Block a user