Change the Theme Configuration for low spec. (#1643)

* Update close-old-issues.yaml

* Compile Winutil

* Update close-old-issues.yaml

* Update close-old-issues.yaml

* Update close-old-issues.yaml

* Added New Dark Themes for Low Spec PC and added GPU Detection

* Compile Winutil

---------

Co-authored-by: Chris Titus <dfm.titus@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
Justawildwolf 2024-03-22 06:55:05 +08:00 committed by GitHub
parent d64a3f7070
commit 0ba0654a2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 68 additions and 4 deletions

View File

@ -1,5 +1,5 @@
{ {
"Classic": { "Classic": {
"ComboBoxBackgroundColor": "#FFFFFF", "ComboBoxBackgroundColor": "#FFFFFF",
"LabelboxForegroundColor": "#000000", "LabelboxForegroundColor": "#000000",
"MainForegroundColor": "#000000", "MainForegroundColor": "#000000",
@ -60,5 +60,35 @@
"BorderColor": "#FFAC1C", "BorderColor": "#FFAC1C",
"BorderOpacity": "0.8", "BorderOpacity": "0.8",
"ShadowPulse": "0:0:3" "ShadowPulse": "0:0:3"
},
"Dark": {
"ComboBoxBackgroundColor": "#000000",
"LabelboxForegroundColor": "#FFEE58",
"MainForegroundColor": "#9CCC65",
"MainBackgroundColor": "#000000",
"LabelBackgroundColor": "#000000",
"LinkForegroundColor": "#add8e6",
"LinkHoverForegroundColor": "#FFFFFF",
"ComboBoxForegroundColor": "#FFEE58",
"ButtonInstallBackgroundColor": "#222222",
"ButtonTweaksBackgroundColor": "#333333",
"ButtonConfigBackgroundColor": "#444444",
"ButtonUpdatesBackgroundColor": "#555555",
"ButtonInstallForegroundColor": "#FFFFFF",
"ButtonTweaksForegroundColor": "#FFFFFF",
"ButtonConfigForegroundColor": "#FFFFFF",
"ButtonUpdatesForegroundColor": "#FFFFFF",
"ButtonBackgroundColor": "#000019",
"ButtonBackgroundPressedColor": "#9CCC65",
"ButtonBackgroundMouseoverColor": "#FF5733",
"ButtonBackgroundSelectedColor": "#FF5733",
"ButtonForegroundColor": "#9CCC65",
"ButtonBorderThickness": "1",
"ButtonMargin": "1",
"ButtonCornerRadius": "2",
"ToggleButtonHeight": "25",
"BorderColor": "#FFAC1C",
"BorderOpacity": "0.2",
"ShadowPulse": "Forever"
} }
} }

View File

@ -0,0 +1,29 @@
function Invoke-GPUCheck {
$gpuInfo = Get-WmiObject Win32_VideoController
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*NVIDIA*") {
return $true # NVIDIA GPU found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon RX*") {
return $true # AMD GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*UHD*") {
return $false # Intel Intergrated GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon(TM)*") {
return $false # AMD Intergrated GPU Found
}
}
}

View File

@ -53,7 +53,12 @@ $sync.runspace.Open()
$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'
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) { if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
$ctttheme = 'Matrix' if (Invoke-GPUCheck -eq $True) {
$ctttheme = 'Matrix'
}
else {
$ctttheme = 'Dark'
}
} }
else { else {
$ctttheme = 'Classic' $ctttheme = 'Classic'
@ -447,4 +452,4 @@ Version : $($sync.version)
}) })
$sync["Form"].ShowDialog() | out-null $sync["Form"].ShowDialog() | out-null
Stop-Transcript Stop-Transcript