fix(ui): split ViewBuilders for Swift 5.7 ten-child limit (#146) #157
@@ -46,9 +46,11 @@ struct SaveMediaRecipeDialog: View {
|
|||||||
|| media.captureColourSpaceMismatch
|
|| media.captureColourSpaceMismatch
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
// Swift 5.7 (Xcode 14.2 CI runner) caps a ViewBuilder body at 10
|
||||||
VStack(alignment: .leading, spacing: 14) {
|
// children (#146); Group blocks are layout-transparent, so field
|
||||||
Text("Save Media Recipe").font(.title3).foregroundStyle(Theme.text)
|
// order and every docs/21 id are unchanged.
|
||||||
|
private var fields: some View {
|
||||||
|
Group {
|
||||||
TextField("Name", text: $media.saveMediaName)
|
TextField("Name", text: $media.saveMediaName)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.accessibilityIdentifier("saveMediaName")
|
.accessibilityIdentifier("saveMediaName")
|
||||||
@@ -61,7 +63,11 @@ struct SaveMediaRecipeDialog: View {
|
|||||||
TextField("Ink set", text: $media.saveMediaInk)
|
TextField("Ink set", text: $media.saveMediaInk)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.accessibilityIdentifier("saveMediaInk")
|
.accessibilityIdentifier("saveMediaInk")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var readOnlyRows: some View {
|
||||||
|
Group {
|
||||||
captureRow("Printer", value: printerCaption,
|
captureRow("Printer", value: printerCaption,
|
||||||
identifier: "saveMediaPrinter")
|
identifier: "saveMediaPrinter")
|
||||||
captureRow("Preset",
|
captureRow("Preset",
|
||||||
@@ -74,6 +80,14 @@ struct SaveMediaRecipeDialog: View {
|
|||||||
value: workflow.profile.calibrationFile.isEmpty
|
value: workflow.profile.calibrationFile.isEmpty
|
||||||
? "None" : workflow.profile.calibrationFile,
|
? "None" : workflow.profile.calibrationFile,
|
||||||
identifier: "saveMediaCal")
|
identifier: "saveMediaCal")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack(alignment: .leading, spacing: 14) {
|
||||||
|
Text("Save Media Recipe").font(.title3).foregroundStyle(Theme.text)
|
||||||
|
fields
|
||||||
|
readOnlyRows
|
||||||
Toggle("Apply calibration to profile",
|
Toggle("Apply calibration to profile",
|
||||||
isOn: $media.saveMediaApplyCal)
|
isOn: $media.saveMediaApplyCal)
|
||||||
.disabled(!media.calApplyable)
|
.disabled(!media.calApplyable)
|
||||||
|
|||||||
@@ -37,6 +37,21 @@ struct SidebarView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
|
header
|
||||||
|
presetBlock
|
||||||
|
mediaBlock
|
||||||
|
studioButtons
|
||||||
|
stepperAndProject
|
||||||
|
}
|
||||||
|
.frame(width: Theme.Metrics.sidebarWidth)
|
||||||
|
.background(Theme.panel)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Swift 5.7 (Xcode 14.2 CI runner) caps a ViewBuilder body at 10
|
||||||
|
// children (#146); these Group blocks are layout-transparent, so
|
||||||
|
// visual order, ids and the 270 pt column are unchanged.
|
||||||
|
private var header: some View {
|
||||||
|
Group {
|
||||||
HStack {
|
HStack {
|
||||||
Image("ICCery-logo")
|
Image("ICCery-logo")
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -65,7 +80,11 @@ struct SidebarView: View {
|
|||||||
.padding(12)
|
.padding(12)
|
||||||
|
|
||||||
Divider().overlay(Theme.border)
|
Divider().overlay(Theme.border)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var presetBlock: some View {
|
||||||
|
Group {
|
||||||
// Preset select (`#presetSelect`) — issue #11. Selection
|
// Preset select (`#presetSelect`) — issue #11. Selection
|
||||||
// applies the preset immediately; names render via Text only.
|
// applies the preset immediately; names render via Text only.
|
||||||
Picker("Preset", selection: Binding(
|
Picker("Preset", selection: Binding(
|
||||||
@@ -97,7 +116,11 @@ struct SidebarView: View {
|
|||||||
}
|
}
|
||||||
.padding(.horizontal, 12)
|
.padding(.horizontal, 12)
|
||||||
.padding(.bottom, 8)
|
.padding(.bottom, 8)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var mediaBlock: some View {
|
||||||
|
Group {
|
||||||
// Media library (`#mediaSelect`) — issue #146. Selection
|
// Media library (`#mediaSelect`) — issue #146. Selection
|
||||||
// applies the recipe immediately, like presets; names render
|
// applies the recipe immediately, like presets; names render
|
||||||
// via Text only (#114). Never reuses `presetSelect` (#137).
|
// via Text only (#114). Never reuses `presetSelect` (#137).
|
||||||
@@ -147,7 +170,11 @@ struct SidebarView: View {
|
|||||||
}
|
}
|
||||||
.padding(.horizontal, 12)
|
.padding(.horizontal, 12)
|
||||||
.padding(.bottom, 8)
|
.padding(.bottom, 8)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var studioButtons: some View {
|
||||||
|
Group {
|
||||||
// Calibrate Printer (`#btnCalibratePrinter`).
|
// Calibrate Printer (`#btnCalibratePrinter`).
|
||||||
Button(action: { model.enterCalibration() }) {
|
Button(action: { model.enterCalibration() }) {
|
||||||
Label("Calibrate Printer", systemImage: "slider.horizontal.3")
|
Label("Calibrate Printer", systemImage: "slider.horizontal.3")
|
||||||
@@ -187,7 +214,11 @@ struct SidebarView: View {
|
|||||||
showing: $showingAllHelp)
|
showing: $showingAllHelp)
|
||||||
.accessibilityIdentifier("btnSpotRead")
|
.accessibilityIdentifier("btnSpotRead")
|
||||||
.padding(.horizontal, 12)
|
.padding(.horizontal, 12)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var stepperAndProject: some View {
|
||||||
|
Group {
|
||||||
Divider().overlay(Theme.border)
|
Divider().overlay(Theme.border)
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
|
|
||||||
@@ -214,8 +245,6 @@ struct SidebarView: View {
|
|||||||
ProjectChip(project: project, showingAllHelp: $showingAllHelp)
|
ProjectChip(project: project, showingAllHelp: $showingAllHelp)
|
||||||
.padding(8)
|
.padding(8)
|
||||||
}
|
}
|
||||||
.frame(width: Theme.Metrics.sidebarWidth)
|
|
||||||
.background(Theme.panel)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user