fix(ui): 缩小卡片并还原设计稿紧凑排布

This commit is contained in:
2026-11-15 17:14:42 +08:00
parent 3c1a2baace
commit d87aa3ccc5
29 changed files with 609 additions and 272 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ struct NativePanelCurve: NSViewRepresentable {
private final class SeriesLayer {
let root = CALayer(), area = CAShapeLayer(), line = CAShapeLayer(), points = CAShapeLayer()
init() {
line.fillColor = nil; line.lineWidth = 1.8; line.lineCap = .round; line.lineJoin = .round
line.fillColor = nil; line.lineWidth = 1.4; line.lineCap = .round; line.lineJoin = .round
root.addSublayer(area); root.addSublayer(line); root.addSublayer(points)
}
func resize(_ bounds: CGRect) {
+2 -2
View File
@@ -80,14 +80,14 @@ struct PanelTrendChart: View {
}
}
private func tooltip(index: Int) -> some View {
VStack(alignment: .leading, spacing: 5) {
VStack(alignment: .leading, spacing: 3) {
Text(dates[index], format: .dateTime.hour().minute().second()).foregroundStyle(.secondary)
tooltipRow(firstLabel, values: first, tint: color, index: index)
if !second.isEmpty { tooltipRow(secondLabel, values: second, tint: secondColor, format: secondValueFormat, index: index) }
if !third.isEmpty { tooltipRow(thirdLabel, values: third, tint: thirdColor, index: index) }
if !fourth.isEmpty { tooltipRow(fourthLabel, values: fourth, tint: fourthColor, index: index) }
}
.font(.system(size: 10)).padding(8)
.font(.system(size: 9)).padding(6)
.background { TooltipBackground() }
.overlay(RoundedRectangle(cornerRadius: 7).strokeBorder(.primary.opacity(0.2)))
}