Make review panel resize content
This commit is contained in:
@@ -394,18 +394,20 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(minWidth: 240, idealWidth: 300, maxWidth: 340, minHeight: 220, maxHeight: 300)
|
.frame(minWidth: 240, idealWidth: 300, maxWidth: 340, maxHeight: .infinity)
|
||||||
|
|
||||||
if let clip = selectedClip {
|
if let clip = selectedClip {
|
||||||
clipEditor(clip)
|
clipEditor(clip)
|
||||||
} else {
|
} else {
|
||||||
Text("Kein Clip ausgewählt")
|
Text("Kein Clip ausgewählt")
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
.frame(maxWidth: .infinity, minHeight: 220)
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.frame(maxHeight: .infinity, alignment: .top)
|
||||||
}
|
}
|
||||||
.padding(10)
|
.padding(10)
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||||
.background(Color(nsColor: .controlBackgroundColor))
|
.background(Color(nsColor: .controlBackgroundColor))
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 8))
|
.clipShape(RoundedRectangle(cornerRadius: 8))
|
||||||
.overlay(
|
.overlay(
|
||||||
@@ -422,10 +424,13 @@ struct ContentView: View {
|
|||||||
set: { processor.updateClip(clip, segmentStart: $0) }
|
set: { processor.updateClip(clip, segmentStart: $0) }
|
||||||
)
|
)
|
||||||
|
|
||||||
return VStack(alignment: .leading, spacing: 8) {
|
return GeometryReader { proxy in
|
||||||
|
let previewHeight = min(max(150, proxy.size.height - 160), 420)
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
ClipPreviewView(clip: liveClip)
|
ClipPreviewView(clip: liveClip)
|
||||||
.id(liveClip.sourcePath)
|
.id(liveClip.sourcePath)
|
||||||
.frame(height: 180)
|
.frame(height: previewHeight)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||||
|
|
||||||
Text(liveClip.displayName)
|
Text(liveClip.displayName)
|
||||||
@@ -470,7 +475,9 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
.disabled(processor.state.isRunning || maxStart <= 0)
|
.disabled(processor.state.isRunning || maxStart <= 0)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .topLeading)
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func currentClip(id: UUID) -> GrowthLapseProjectClip? {
|
private func currentClip(id: UUID) -> GrowthLapseProjectClip? {
|
||||||
@@ -656,7 +663,7 @@ private struct ResizableVerticalStack<Top: View, Bottom: View>: View {
|
|||||||
|
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
top()
|
top()
|
||||||
.frame(height: clampedTopHeight)
|
.frame(height: clampedTopHeight, alignment: .top)
|
||||||
.clipped()
|
.clipped()
|
||||||
|
|
||||||
SplitHandle()
|
SplitHandle()
|
||||||
@@ -678,7 +685,7 @@ private struct ResizableVerticalStack<Top: View, Bottom: View>: View {
|
|||||||
.help("Ziehen, um Clip-Nachbearbeitung und Log größer oder kleiner zu machen.")
|
.help("Ziehen, um Clip-Nachbearbeitung und Log größer oder kleiner zu machen.")
|
||||||
|
|
||||||
bottom()
|
bottom()
|
||||||
.frame(height: max(minBottomHeight, availableHeight - clampedTopHeight))
|
.frame(height: max(minBottomHeight, availableHeight - clampedTopHeight), alignment: .top)
|
||||||
.clipped()
|
.clipped()
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|||||||
Reference in New Issue
Block a user