mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05: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:
@ -61,13 +61,13 @@ function Set-WinUtilTaskbaritem {
|
|||||||
if ($overlay) {
|
if ($overlay) {
|
||||||
switch ($overlay) {
|
switch ($overlay) {
|
||||||
'logo' {
|
'logo' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "Logo" -Size 80 -Render)
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["logorender"]
|
||||||
}
|
}
|
||||||
'checkmark' {
|
'checkmark' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "checkmark" -Size 512 -Render)
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["checkmarkrender"]
|
||||||
}
|
}
|
||||||
'warning' {
|
'warning' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (Invoke-WinUtilAssets -Type "warning" -Size 512 -Render)
|
$sync["Form"].taskbarItemInfo.Overlay = $sync["warningrender"]
|
||||||
}
|
}
|
||||||
'None' {
|
'None' {
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = $null
|
$sync["Form"].taskbarItemInfo.Overlay = $null
|
||||||
|
@ -457,6 +457,10 @@ $winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
|||||||
|
|
||||||
$winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico"
|
$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"
|
Set-WinUtilTaskbaritem -overlay "logo"
|
||||||
|
|
||||||
$sync["Form"].Add_Activated({
|
$sync["Form"].Add_Activated({
|
||||||
|
Reference in New Issue
Block a user