mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 17:46:58 +00:00
Extract shared TimeInterval.formattedAsTimestamp replacing 8 identical formatTime/formattedTime implementations across player views. Remove unused currentTime parameter from GestureSeekPreviewView. Consolidate duplicated geometry math in MacOSControlBar into seekPreviewPosition().
32 lines
907 B
Swift
32 lines
907 B
Swift
//
|
|
// SeekTimePreviewView.swift
|
|
// Yattee
|
|
//
|
|
// Seek time preview shown when no storyboard thumbnails are available.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
/// Lightweight seek time pill displayed above the seek bar when no storyboard is available.
|
|
struct SeekTimePreviewView: View {
|
|
let seekTime: TimeInterval
|
|
let buttonBackground: ButtonBackgroundStyle
|
|
let theme: ControlsTheme
|
|
|
|
var body: some View {
|
|
Text(seekTime.formattedAsTimestamp)
|
|
.font(.system(size: 16, weight: .medium))
|
|
.monospacedDigit()
|
|
.foregroundStyle(.white)
|
|
.padding(.vertical, 8)
|
|
.padding(.horizontal, 12)
|
|
.glassBackground(
|
|
buttonBackground.glassStyle ?? .regular,
|
|
in: .rect(cornerRadius: 8),
|
|
fallback: .ultraThinMaterial,
|
|
colorScheme: .dark
|
|
)
|
|
.shadow(radius: 4)
|
|
}
|
|
}
|