fix(power): 完善电池卡片的共同供电判定、功率图标与预估续航
按适配器和电池的实际贡献判定共同供电,以双图标和双色柱展示两路功率。同步三语预估续航文案,在仅外接供电时隐藏估时行。
This commit is contained in:
@@ -11,6 +11,7 @@ struct ResourceCard<Chart: View, Content: View>: View {
|
||||
let symbol: String
|
||||
let color: Color
|
||||
let value: String
|
||||
var companionIcon: (symbol: String, color: Color)? = nil
|
||||
var secondaryValue: String? = nil
|
||||
var valueColor: Color? = nil
|
||||
var secondaryValueColor: Color? = nil
|
||||
@@ -90,7 +91,12 @@ struct ResourceCard<Chart: View, Content: View>: View {
|
||||
Label {
|
||||
Text(title).foregroundStyle(statusWarning ? .red : .primary)
|
||||
} icon: {
|
||||
Image(systemName: symbol).foregroundStyle(statusWarning ? .red : color)
|
||||
HStack(spacing: 1) {
|
||||
Image(systemName: symbol).foregroundStyle(statusWarning ? .red : color)
|
||||
if let companionIcon {
|
||||
Image(systemName: companionIcon.symbol).foregroundStyle(companionIcon.color)
|
||||
}
|
||||
}
|
||||
}
|
||||
.font(.system(size: 11, weight: .semibold)).fixedSize()
|
||||
if let titleBadge {
|
||||
|
||||
Reference in New Issue
Block a user