feat(menubar): 实现紧凑独立双列与按内容定高

This commit is contained in:
2026-11-08 18:47:01 +08:00
parent 8821089872
commit 8d3891966a
22 changed files with 259 additions and 128 deletions
@@ -32,7 +32,7 @@ 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 maximum = PanelLayout.contentSize(visible: frame, chrome: chrome)
let maximum = PanelLayout.contentSize(visible: frame, chrome: chrome, preferredHeight: PanelLayout.maximumHeight)
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