-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tightened up the inspector UI design to make it more consistent (#949)
* Tightened up the inspector UI design to make it more consistent * Disabled failing tests for now.
- Loading branch information
1 parent
8911e11
commit 52e6898
Showing
6 changed files
with
184 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// InspectorField.swift | ||
// CodeEdit | ||
// | ||
// Created by Austin Condiff on 1/12/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct InspectorField<Content: View>: View { | ||
var label: String | ||
let content: Content | ||
|
||
init(_ label: String, @ViewBuilder _ content: () -> Content) { | ||
self.label = label | ||
self.content = content() | ||
} | ||
|
||
var body: some View { | ||
HStack(alignment: .top, spacing: 5) { | ||
Text(label) | ||
.foregroundColor(.primary) | ||
.fontWeight(.regular) | ||
.font(.system(size: 10)) | ||
.padding(.top, 3) | ||
.frame(maxWidth: 72, alignment: .trailing) | ||
VStack(alignment: .leading) { | ||
content | ||
} | ||
.frame(maxWidth: .infinity) | ||
} | ||
} | ||
} | ||
|
||
struct InspectorField_Previews: PreviewProvider { | ||
static var previews: some View { | ||
InspectorField("Section Label") { | ||
Text("Preview") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// InspectorSection.swift | ||
// CodeEdit | ||
// | ||
// Created by Austin Condiff on 1/12/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct InspectorSection<Content: View>: View { | ||
var label: String | ||
let content: Content | ||
|
||
init(_ label: String, @ViewBuilder _ content: () -> Content) { | ||
self.label = label | ||
self.content = content() | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 11) { | ||
Text(label) | ||
.foregroundColor(.secondary) | ||
.fontWeight(.bold) | ||
.font(.system(size: 12)) | ||
.padding(.leading, -1) | ||
VStack(alignment: .trailing, spacing: 5) { | ||
content | ||
Divider() | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct InspectorSection_Previews: PreviewProvider { | ||
static var previews: some View { | ||
InspectorSection("Section Label") { | ||
Text("Preview") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters