refactor(ui): 统一胶囊页签并将面板收窄至640点

This commit is contained in:
2026-11-08 15:06:27 +08:00
parent 48f7ac73c0
commit 521319ef93
18 changed files with 223 additions and 26 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import CoreGraphics
nonisolated enum PanelLayout {
static let baseCardHeight: CGFloat = 204
static func headerHeight(width: CGFloat) -> CGFloat { width >= 840 ? 32 : 64 }
static func columns(width: CGFloat) -> Int { width >= 680 ? 2 : 1 }
static func columns(width: CGFloat) -> Int { width >= 560 ? 2 : 1 }
static func cardWidth(size: CGSize) -> CGFloat {
let count = columns(width: size.width)
return max(0, (size.width - 20 - CGFloat(count - 1) * 8) / CGFloat(count))
@@ -28,7 +28,7 @@ nonisolated enum PanelLayout {
}
static func contentSize(visible: CGRect, chrome: CGSize = .zero) -> CGSize {
CGSize(width: max(1, min(960, visible.width - 32 - max(0, chrome.width))),
CGSize(width: max(1, min(640, visible.width - 32 - max(0, chrome.width))),
height: max(1, min(800, visible.height - 32 - max(0, chrome.height))))
}
static func centeredFrame(_ frame: CGRect, visible: CGRect) -> CGRect {