Fixed the size of the timer label for the ContentView view in the Sample app target.

This commit is contained in:
2026-07-04 13:52:40 +02:00
parent be130eb05f
commit 5e102f21e1
@@ -13,6 +13,9 @@ public struct RecordingView: View {
/// The model that owns the recording state and drives the view's controls. /// The model that owns the recording state and drives the view's controls.
@State private var model: Model @State private var model: Model
/// The font size of the timer's label, scaled relative to the current dynamic type size.
@ScaledMetric private var fontSize = Constant.Size.timer
/// The closure invoked with the transcription of every processed recording. /// The closure invoked with the transcription of every processed recording.
private let onTranscription: (Transcription) -> Void private let onTranscription: (Transcription) -> Void
@@ -49,7 +52,7 @@ public struct RecordingView: View {
) { ) {
if model.shouldShowTimer { if model.shouldShowTimer {
Text(model.textTimer) Text(model.textTimer)
.font(.largeTitle) .font(.system(size: fontSize))
.fontWeight(.bold) .fontWeight(.bold)
.foregroundStyle(.primary) .foregroundStyle(.primary)
.monospacedDigit() .monospacedDigit()
@@ -119,6 +122,11 @@ public struct RecordingView: View {
/// The constant values used across the view. /// The constant values used across the view.
private enum Constant { private enum Constant {
/// The spacing constants.
enum Size {
/// The font size of the timer label.
static let timer: CGFloat = 100
}
/// The spacing constants. /// The spacing constants.
enum Spacing { enum Spacing {
/// The spacing between the elements of a stack. /// The spacing between the elements of a stack.