Files
workouts/Workouts/Views/Common/SecondsStepperRow.swift
T
rzen 62ca446136 Adjust rest time with a 1-second stepper instead of the wheel
The wheel row lands back on a Stepper (shared SecondsStepperRow), but
keeps the fine 1-second step; holding a stepper button auto-repeats
with acceleration, so the 10-180s range still traverses quickly.
2026-07-16 20:10:30 -04:00

31 lines
867 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// SecondsStepperRow.swift
// Workouts
//
// Copyright 2026 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
/// A Form row for adjusting a seconds value with a stepper in 1-second steps —
/// fine-grained (the old 5-second step overshot), and holding a stepper button
/// auto-repeats with acceleration, so the 10180s range still traverses quickly.
/// Used for the rest-time settings in Settings and the routine editor.
struct SecondsStepperRow: View {
let title: String
let range: ClosedRange<Int>
@Binding var seconds: Int
var body: some View {
Stepper(value: $seconds, in: range, step: 1) {
HStack {
Text(title)
Spacer()
Text("\(seconds)s")
.monospacedDigit()
.foregroundStyle(.secondary)
}
}
}
}