progression timer wont show hours unless media is longer than an hour

This commit is contained in:
Seiike 2025-03-22 12:29:58 +01:00
parent 4f6b7fbb13
commit a5f9877474

View file

@ -42,10 +42,13 @@ struct MusicProgressSlider<T: BinaryFloatingPoint>: View {
}
HStack {
Text(value.asTimeString(style: .positional, showHours: true))
// Determine if we should show hours based on the total duration.
let shouldShowHours = inRange.upperBound >= 3600
Text(value.asTimeString(style: .positional, showHours: shouldShowHours))
Spacer(minLength: 0)
Text("-" + (inRange.upperBound - value).asTimeString(style: .positional, showHours: true))
Text("-" + (inRange.upperBound - value).asTimeString(style: .positional, showHours: shouldShowHours))
}
.font(.system(size: 12))
.foregroundColor(isActive ? fillColor : emptyColor)
}