feat(menubar): 拆分紧凑双页面板并按页采样

This commit is contained in:
2026-11-08 10:42:55 +08:00
parent ac8b4a7e6a
commit 41dcc497b5
36 changed files with 465 additions and 288 deletions
@@ -32,7 +32,9 @@ struct PanelWindowObserver: NSViewRepresentable {
let frame = (window.screen ?? NSScreen.main)?.visibleFrame ?? NSRect(x: 0, y: 0, width: 1000, height: 760)
let chrome = CGSize(width: max(0, window.frame.width - window.contentLayoutRect.width),
height: max(0, window.frame.height - window.contentLayoutRect.height))
let size = PanelLayout.contentSize(visible: frame, chrome: chrome)
let maximum = PanelLayout.contentSize(visible: frame, chrome: chrome)
let size = CGSize(width: min(maximum.width, window.contentLayoutRect.width),
height: min(maximum.height, window.contentLayoutRect.height))
DispatchQueue.main.async { [weak self, weak window] in
guard let self, let window else { return }
self.update(size)