mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 01:26:57 +00:00
Add separate glass capsule for chapter title above seek preview
Extract chapter title from inside the storyboard preview into a standalone ChapterCapsuleView with its own glass capsule background. The capsule follows the seek position horizontally but independently clamps to screen edges using alignmentGuide, allowing it to be wider than the storyboard thumbnail without going offscreen.
This commit is contained in:
@@ -20,20 +20,31 @@ struct GestureSeekPreviewView: View {
|
||||
let theme: ControlsTheme
|
||||
let chapters: [VideoChapter]
|
||||
let isActive: Bool
|
||||
var availableWidth: CGFloat = 320
|
||||
|
||||
@State private var opacity: Double = 0
|
||||
|
||||
private var currentChapter: VideoChapter? {
|
||||
chapters.last { $0.startTime <= seekTime }
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
// Only show if storyboard is available
|
||||
VStack(spacing: 6) {
|
||||
if let chapter = currentChapter {
|
||||
ChapterCapsuleView(
|
||||
title: chapter.title,
|
||||
buttonBackground: buttonBackground
|
||||
)
|
||||
.frame(maxWidth: availableWidth - 16)
|
||||
}
|
||||
|
||||
if let storyboard {
|
||||
SeekPreviewView(
|
||||
storyboard: storyboard,
|
||||
seekTime: seekTime,
|
||||
storyboardService: storyboardService,
|
||||
buttonBackground: buttonBackground,
|
||||
theme: theme,
|
||||
chapters: chapters
|
||||
theme: theme
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user