Collect other apps' menu bar items into a hamburger panel

The menu bar icon is now a hamburger whose panel gathers every other
app's status item via the Accessibility API, so tray icons no longer
need to be hunted down across the menu bar. Items can be opened from
the panel, and a best-effort toggle pushes them off the real menu bar
so they only live there.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-26 23:02:28 +08:00
parent 41a5917b42
commit 373fda738e
7 changed files with 365 additions and 12 deletions
+13 -2
View File
@@ -7,8 +7,12 @@ struct SimpleTopBarApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
var body: some Scene {
MenuBarExtra("SimpleTopBar", systemImage: "menubar.rectangle") {
TopBarView(model: AppListModel.shared)
MenuBarExtra("SimpleTopBar", systemImage: "line.3.horizontal") {
TopBarView(
model: AppListModel.shared,
menuBar: MenuBarItemManager.shared,
hider: MenuBarHider.shared
)
}
.menuBarExtraStyle(.window)
}
@@ -31,6 +35,13 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
AppListModel.shared.start()
MenuBarItemManager.shared.start()
MenuBarHider.shared.prepare()
}
func applicationWillTerminate(_ notification: Notification) {
// Never leave the menu bar resized behind us.
MenuBarHider.shared.restore()
}
}