Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Add header and padding to Launchpad console sheet

Lakr495cebea4c3c
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift
index a2d3dc6b..365b1629 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadPreview.swift
@@ -86,7 +86,7 @@
creation.applyPreview(failed: true)
await sheet(.creation("ios27-rc"), "08b-creation-failed", suffix)
creation.applyPreview()
- await standalone("08c-creation-log", suffix, size: NSSize(width: 900, height: 560)) {
+ await standalone("08c-creation-log", suffix, size: NSSize(width: 960, height: 700)) {
VPhoneLaunchpadConsoleView(title: "ios27-rc Creation Log", url: creation.logFile)
}
model.machines.selection = "frida-lab"
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadConsoleView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadConsoleView.swift
index 60f50988..793b063b 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadConsoleView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadConsoleView.swift
@@ -1,20 +1,34 @@
import SwiftUI
-/// A log in a terminal that fills the sheet: a machine's console, which
-/// `vm launch` writes, or a creation log.
+/// A sheet for a machine's console, which `vm launch` writes, or a creation log.
struct VPhoneLaunchpadConsoleView: View {
let title: LocalizedStringKey
let url: URL
@Environment(\.dismiss) private var dismiss
+ private let padding: CGFloat = 16
var body: some View {
- VPhoneLaunchpadLogTerminal(url: url)
- .frame(minWidth: 900, maxWidth: .infinity, minHeight: 560, maxHeight: .infinity)
- .navigationTitle(title)
- .toolbar {
- ToolbarItem(placement: .confirmationAction) {
- Button("Close") { dismiss() }
- }
+ VStack(spacing: 12) {
+ HStack {
+ Text(title)
+ .font(.headline)
+ Spacer()
}
+
+ Divider()
+ .padding(.horizontal, -padding)
+
+ VPhoneLaunchpadLogTerminal(url: url)
+ .frame(minWidth: 900, maxWidth: .infinity, minHeight: 560, maxHeight: .infinity)
+
+ Divider()
+ .padding(.horizontal, -padding)
+
+ HStack {
+ Spacer()
+ Button("Close") { dismiss() }
+ }
+ }
+ .padding(padding)
}
}