A few UI tweaks around section headers mostly.

This commit is contained in:
Casey Fleser 2022-08-21 07:50:26 -05:00
parent 4d67317ebb
commit 762f0b7bc0
5 changed files with 20 additions and 22 deletions

View file

@ -15,11 +15,14 @@ struct ContentHeader: View {
}
var body: some View {
Text(title)
.fontWeight(.semibold)
.foregroundColor(Color("ContentHeader"))
.padding(.top)
.padding(.bottom, 4.0)
VStack(alignment: .leading, spacing: 4) {
Text(title)
.fontWeight(.semibold)
.foregroundColor(Color("ContentHeader"))
.padding(.top)
Divider()
}
.padding(.bottom, 4)
}
}

View file

@ -16,9 +16,7 @@ struct AppContent: View {
var body: some View {
VStack(alignment: .leading, spacing: 0.0) {
Text("PATHS")
.fontWeight(.semibold)
.foregroundColor(.secondary)
ContentHeader("Paths")
PathRow(title: "Bundle Path", path: app.bundlePath)
if let sandboxPath = app.sandboxPath {

View file

@ -83,14 +83,14 @@ struct DeviceContent: View {
var body: some View {
VStack(alignment: .leading, spacing: 3.0) {
if !device.isAvailable {
ErrorView(
title: "\(device.name) is unavailable",
description: device.availabilityError ?? "Unknown Error")
}
ContentHeader("Paths")
Group {
if !device.isAvailable {
ErrorView(
title: "\(device.name) is unavailable",
description: device.availabilityError ?? "Unknown Error")
}
PathRow(title: "Data Path", path: device.dataPath)
PathRow(title: "Log Path", path: device.logPath)
}
@ -113,6 +113,7 @@ struct DeviceContent: View {
}
.buttonStyle(.systemIcon("record.circle", active: device.isRecording))
}
.environment(\.isEnabled, isBooted)
ContentHeader("UI")
HStack(spacing: 16) {
@ -136,8 +137,8 @@ struct DeviceContent: View {
.opacity(isBooted ? 1.0 : 0.5)
}
}
.environment(\.isEnabled, isBooted)
}
.environment(\.isEnabled, isBooted)
.onAppear {
device.discoverUI()
}

View file

@ -16,6 +16,7 @@ struct DeviceTypeContent: View {
var body: some View {
VStack(alignment: .leading, spacing: 0.0) {
ContentHeader("Paths")
PathRow(title: "Bundle Path", path: deviceType.bundlePath)
}
.font(.subheadline)

View file

@ -30,17 +30,12 @@ struct RuntimeContent: View {
description: runtime.availabilityError ?? "Unknown Error")
}
Text("PATHS")
.fontWeight(.semibold)
.foregroundColor(.secondary)
ContentHeader("Paths")
if !runtime.bundlePath.isEmpty {
PathRow(title: "Bundle Path", path: runtime.bundlePath)
}
Text("SUPPORTED DEVICES \(runtime.isPlaceholder ? "(partial list)" : "")")
.fontWeight(.semibold)
.foregroundColor(.secondary)
.padding(.top, 8.0)
ContentHeader("Supported devices\(runtime.isPlaceholder ? " (partial list)" : "")")
ForEach(items) { item in
Text("\(item.name)")
}