feat(menubar): 实现统一资源面板与独立滚动进程表
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ResourceCard<Content: View>: View {
|
||||
let title: LocalizedStringKey
|
||||
let symbol: String
|
||||
let color: Color
|
||||
let value: String
|
||||
@ViewBuilder var content: () -> Content
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Label(title, systemImage: symbol).font(.system(size: 13, weight: .semibold)).foregroundStyle(color)
|
||||
Spacer(minLength: 6)
|
||||
Text(verbatim: value).font(.system(size: 20, weight: .semibold, design: .rounded)).monospacedDigit()
|
||||
}
|
||||
content()
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
.font(.system(size: 11))
|
||||
.padding(12)
|
||||
.frame(maxWidth: .infinity, minHeight: 250, alignment: .topLeading)
|
||||
.background(Color("PanelCard"), in: .rect(cornerRadius: 14))
|
||||
.overlay(RoundedRectangle(cornerRadius: 14).strokeBorder(.primary.opacity(0.1)))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user