Shorten the icon reveal when opening a tray menu

The menu is its own window anchored where the item was revealed, so it
survives if the bar re-hides immediately. Revealing for ~0.3s instead of
over a second makes the flash far less noticeable while still opening
the menu in view.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-27 02:53:41 +08:00
parent 9c5416d27e
commit 2312e09105
4 changed files with 58 additions and 9 deletions
+4 -3
View File
@@ -117,10 +117,11 @@ final class MenuBarItemManager: ObservableObject {
return
}
hider.suspend()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.18) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
_ = self.performPress(item)
// Let the menu finish appearing before the bar contracts again.
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
// The menu is its own window, positioned at the item's on-screen
// spot, so the bar can be re-hidden almost immediately.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
hider.resume()
}
}