-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Theme support, initial functions. (#878)
* Fix power profile (#766) * Fix power profile query * fix syntax * fix * Update Invoke-WPFUltimatePerformance.ps1 * Update winutil.ps1 * power profile fix * Adding Nomacs Opensource free and fast Image viewer * Adding theme support Later when this is tested well, we can do one of 2 things. 1. Pass theme on a command line so people with bad vision will have an option to have a better (more visible theme) 2. Create a drop down with themes and a save button which would save it ti some local config file * Fix for the compile script --------- Co-authored-by: Chris Titus <[email protected]>
- Loading branch information
1 parent
836c34f
commit 781ba4e
Showing
7 changed files
with
553 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"Classic": { | ||
"ComboBoxBackgroundColor": "#777777", | ||
"LabelboxForegroundColor": "#000000", | ||
"MainForegroundColor": "#000000", | ||
"MainBackgroundColor": "#777777", | ||
"LabelBackgroundColor": "#777777", | ||
"ComboBoxForegroundColor": "#000000", | ||
"ButtonInstallBackgroundColor": "#222222", | ||
"ButtonTweaksBackgroundColor": "#333333", | ||
"ButtonConfigBackgroundColor": "#444444", | ||
"ButtonUpdatesBackgroundColor": "#555555", | ||
"ButtonInstallForegroundColor": "#FFFFFF", | ||
"ButtonBackgroundColor": "#CACACA", | ||
"ButtonBackgroundPressedColor": "#FFFFFF", | ||
"ButtonBackgroundMouseoverColor": "AliceBlue", | ||
"ButtonForegroundColor": "#000000", | ||
"ButtonBorderThickness": "0", | ||
"ButtonMargin": "0,3,0,3", | ||
"ButtonCornerRadius": "0" | ||
}, | ||
"Matrix": { | ||
"ComboBoxBackgroundColor": "#000000", | ||
"LabelboxForegroundColor": "#FFEE58", | ||
"MainForegroundColor": "#9CCC65", | ||
"MainBackgroundColor": "#000000", | ||
"LabelBackgroundColor": "#000000", | ||
"ComboBoxForegroundColor": "#FFEE58", | ||
"ButtonInstallBackgroundColor": "#222222", | ||
"ButtonTweaksBackgroundColor": "#333333", | ||
"ButtonConfigBackgroundColor": "#444444", | ||
"ButtonUpdatesBackgroundColor": "#555555", | ||
"ButtonInstallForegroundColor": "#FFFFFF", | ||
"ButtonBackgroundColor": "#000000", | ||
"ButtonBackgroundPressedColor": "#FFFFFF", | ||
"ButtonBackgroundMouseoverColor": "#A55A64", | ||
"ButtonForegroundColor": "#9CCC65", | ||
"ButtonBorderThickness": "3", | ||
"ButtonMargin": "2", | ||
"ButtonCornerRadius": "4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function Set-WinUtilUITheme { | ||
<# | ||
.DESCRIPTION | ||
This function will set theme to the XAML file | ||
.EXAMPLE | ||
Set-WinUtilUITheme -inputXAML $inputXAML | ||
#> | ||
param | ||
( | ||
[Parameter(Mandatory=$true, Position=0)] | ||
[string] $inputXML, | ||
[Parameter(Mandatory=$false, Position=1)] | ||
[string] $themeName = 'matrix' | ||
) | ||
|
||
try { | ||
# Convert the JSON to a PowerShell object | ||
$themes = $sync.configs.themes | ||
# Select the specified theme | ||
$selectedTheme = $themes.$themeName | ||
|
||
if ($selectedTheme) { | ||
# Loop through all key-value pairs in the selected theme | ||
foreach ($property in $selectedTheme.PSObject.Properties) { | ||
$key = $property.Name | ||
$value = $property.Value | ||
# Add curly braces around the key | ||
$formattedKey = "{$key}" | ||
# Replace the key with the value in the input XML | ||
$inputXML = $inputXML.Replace($formattedKey, $value) | ||
} | ||
} | ||
else { | ||
Write-Host "Theme '$themeName' not found." | ||
} | ||
|
||
} | ||
catch { | ||
Write-Warning "Unable to apply theme" | ||
Write-Warning $psitem.Exception.StackTrace | ||
} | ||
|
||
return $inputXML; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.