Hide menu bar icons with a cover instead of moving them off screen

Sliding the icons off the screen meant bringing them all back just to
open one menu, which flickered. Draw a frosted window over the other
apps' icons instead: they keep their real positions, so tapping a tile
opens its menu in place with no reveal, and the cover leaves a gap so
the hamburger is never hidden.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-27 03:06:15 +08:00
parent 2312e09105
commit 3e57efe312
6 changed files with 246 additions and 143 deletions
+10 -10
View File
@@ -43,27 +43,27 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
AppListModel.shared.start()
MenuBarItemManager.shared.start()
// Create the hamburger before the hider so it is placed in the visible
// part of the bar; the hider then contracts the space around it.
// Create the hamburger before the cover so its own icon is never covered.
setupStatusItem()
MenuBarHider.shared.prepare()
MenuBarItemManager.shared.refresh()
if CommandLine.arguments.contains("--diag-press") {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
MenuBarHider.shared.suspend()
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2.25) {
if let item = MenuBarItemManager.enumerate().first(where: {
$0.title.lowercased().contains("wireguard")
}) {
NSLog("diag-press: pressing \(item.appName) after brief reveal")
NSLog("diag-press: pressing \(item.appName)")
_ = AXUIElementPerformAction(item.element, kAXPressAction as CFString)
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2.45) {
MenuBarHider.shared.resume()
DispatchQueue.main.asyncAfter(deadline: .now() + 3.5) {
dumpWindows()
}
DispatchQueue.main.asyncAfter(deadline: .now() + 4.5) {
return
}
if CommandLine.arguments.contains("--diag-cover") {
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
dumpWindows()
}
return