mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-18 15:12:09 +00:00
progression timer wont show hours unless media is longer than an hour
This commit is contained in:
parent
4f6b7fbb13
commit
a5f9877474
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue