mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
performance improvement
instead of rendering the image another time on each item switch, it caches it at the start and uses the render afterwards
This commit is contained in:
parent
4b741ce430
commit
5885c067e0
@ -61,13 +61,13 @@ function Set-WinUtilTaskbaritem {
|
||||
if ($overlay) {
|
||||
switch ($overlay) {
|
||||
'logo' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "Logo" -Size 80 -Render)
|
||||
$sync["Form"].taskbarItemInfo.Overlay = $sync["logorender"]
|
||||
}
|
||||
'checkmark' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "checkmark" -Size 512 -Render)
|
||||
$sync["Form"].taskbarItemInfo.Overlay = $sync["checkmarkrender"]
|
||||
}
|
||||
'warning' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "warning" -Size 512 -Render)
|
||||
$sync["Form"].taskbarItemInfo.Overlay = $sync["warningrender"]
|
||||
}
|
||||
'None' {
|
||||
$sync["Form"].taskbarItemInfo.Overlay = $null
|
||||
|
@ -457,6 +457,10 @@ $winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
||||
|
||||
$winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico"
|
||||
|
||||
$sync["logorender"] = (Invoke-WinUtilAssets -Type "Logo" -Size 90 -Render)
|
||||
$sync["checkmarkrender"] = (Invoke-WinUtilAssets -Type "checkmark" -Size 512 -Render)
|
||||
$sync["warningrender"] = (Invoke-WinUtilAssets -Type "warning" -Size 512 -Render)
|
||||
|
||||
Set-WinUtilTaskbaritem -overlay "logo"
|
||||
|
||||
$sync["Form"].Add_Activated({
|
||||
|
Loading…
Reference in New Issue
Block a user