Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Put the page picker beside the machine name, name the activity with its bar

Lakr4f3cee3f1235
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineActions.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineActions.swift
index d041922b..cd4d5265 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineActions.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineActions.swift
@@ -257,6 +257,9 @@ extension VPhoneLaunchpadMachineLibrary {
panel.title = String(localized: "Export \(machine.name)")
panel.allowedContentTypes = [.vphoneExportedArchive]
panel.nameFieldStringValue = Self.exportFileName(machine)
+ // Saving as Mulberry.vpea, not Mulberry: the archive type is
+ // what Import… and a double-click recognize.
+ panel.isExtensionHidden = false
panel.present { url in
Task { await self.export([(machine, url)]) }
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift
index 7745b035..bbdeb152 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineInspector.swift
@@ -6,9 +6,11 @@ import SwiftUI
/// A machine's run state as the table and the inspector show it.
struct VPhoneLaunchpadMachineStateLabel: View {
let state: VPhoneLaunchpadMachineLibrary.RunState
- /// An export's or a creation's IPSW download progress, shown as a bar in
- /// place of the activity text, which becomes its help tag.
+ /// An export's or a creation's IPSW download progress, shown as a bar.
var progress: Double?
+ /// The activity beside the bar, as the inspector has room for (Exporting…
+ /// 6%); the table's column keeps only the bar, with the text as help.
+ var namesActivity = false
/// A stopped machine whose Core Bundle is not installed.
var isDamaged = false
@@ -21,6 +23,9 @@ struct VPhoneLaunchpadMachineStateLabel: View {
}
if let progress {
HStack(spacing: 6) {
+ if namesActivity {
+ Text(text).lineLimit(1).fixedSize()
+ }
ProgressView(value: progress)
.controlSize(.small)
Text(progress, format: .percent.precision(.fractionLength(0)))
@@ -116,6 +121,7 @@ struct VPhoneLaunchpadMachineInspector: View {
VPhoneLaunchpadMachineStateLabel(
state: library.state(of: machine.path),
progress: library.progress(of: machine.path),
+ namesActivity: true,
isDamaged: library.isDamaged(machine.path),
)
}
@@ -124,12 +130,13 @@ struct VPhoneLaunchpadMachineInspector: View {
LabeledContent("Started", value: started.formatted(date: .omitted, time: .shortened))
}
} header: {
- Text(machine.name)
- .font(.headline)
- } footer: {
- // Under the card rather than in it: it switches the whole
+ // The page picker beside the name: it switches the whole
// inspector, not a row. The console is in the Logs menu.
HStack {
+ Text(machine.name)
+ .font(.headline)
+ .lineLimit(1)
+ .truncationMode(.middle)
Spacer()
Picker("Page", selection: $page) {
Text("General").tag(Page.general)
@@ -139,10 +146,9 @@ struct VPhoneLaunchpadMachineInspector: View {
.pickerStyle(.segmented)
.labelsHidden()
.fixedSize()
- Spacer()
+ .controlSize(.small)
}
.foregroundStyle(.primary)
- .padding(.top, 4)
}
switch page {
@@ -345,7 +351,7 @@ struct VPhoneLaunchpadMachineInspector: View {
.help(patchCatalogError)
} else {
ProgressView()
- .controlSize(.small)
+ .controlSize(.small)
.frame(maxWidth: .infinity)
}
} header: {