From 6c250ede37527c07f0245c31850da6919fff5d32 Mon Sep 17 00:00:00 2001 From: jos3ph1205 Date: Mon, 23 Mar 2026 11:35:33 +0800 Subject: [PATCH] Fix round style fade animation using WinSetTransparent instead of AnimateWindow --- .idea/.gitignore | 10 ++++++++++ .idea/misc.xml | 17 +++++++++++++++++ Notify.ahk | 20 ++++++++++++++++++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..00e42f2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/Notify.ahk b/Notify.ahk index 16a5d88..282b289 100644 --- a/Notify.ahk +++ b/Notify.ahk @@ -504,7 +504,7 @@ Class Notify { g.gIndex := ++gIndex m['hwnd'] := g.handle := g.hwnd - for value in ['pos', 'mon', 'hideHex', 'hideDur', 'tag', 'dga'] + for value in ['pos', 'mon', 'hideHex', 'hideDur', 'tag', 'dga', 'style'] g.%value% := m[value] ;============================================== @@ -801,8 +801,24 @@ Class Notify { { SetTimer(g.boundFuncTimer, 0) - if g.hideHex && (fromMethod != 'close' || g.dga) + if (g.style = "round" && (fromMethod != 'close' || g.dga)) { + total := g.hideDur + steps := Max(10, Min(30, g.hideDur / 10)) + delay := g.hideDur / steps + + WinSetTransparent(255, g) + + Loop steps { + progress := A_Index / steps + alpha := Round(255 * (1 - progress)) ; linear fade + + try WinSetTransparent(alpha, g) + Sleep(delay) + } + + } else if g.hideHex && (fromMethod != 'close' || g.dga) { try DllCall('AnimateWindow', 'Ptr', g.hwnd, 'Int', g.hideDur, 'Int', Format('{:#X}', g.hideHex + 0x10000)) + } g.Destroy()