Add new changes for the battery percentage inconsistency

This commit is contained in:
JoelVR2k 2025-11-14 10:58:10 -06:00 • committed by Hariharan Mudaliar
commit 4d12c3e18c

View file

@ -182,10 +182,17 @@ struct DynamicIslandBatteryView: View {
var body: some View {
HStack {
if Defaults[.showBatteryPercentage] {
Text("\(Int32(levelBattery))%")
.font(.callout)
.foregroundStyle(.white)
.frame(width: 40, alignment: .trailing)
ZStack(alignment: .trailing) {
Text("100%")
.font(.callout)
.hidden()
Text("\(Int32(levelBattery))%")
.font(.callout)
.foregroundStyle(.white)
.lineLimit(1)
}
.fixedSize(horizontal: true, vertical: false)
}
BatteryView(
levelBattery: levelBattery,