Skip to content

Commit fb5a322

Browse files
authored
Merge pull request #3 from jarne/feat/improve-edit-ui
Feat: improve command edit UI
2 parents 319a0d4 + efa47f6 commit fb5a322

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Commandoak/View/CommandDetailView.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ struct CommandDetailView: View {
2121
TextField("Name", text: $name)
2222
.padding()
2323
TextField("Icon", text: $icon)
24-
.padding()
25-
TextField("Command", text: $execute)
24+
.onChange(of: icon) { _, newState in
25+
self.icon = String(newState.prefix(1))
26+
}
2627
.padding()
2728
}
29+
.textFieldStyle(.roundedBorder)
2830
.toolbar {
2931
ToolbarItem(placement: .confirmationAction) {
3032
Button("Save") {
@@ -48,6 +50,13 @@ struct CommandDetailView: View {
4850
execute = cmd.execute
4951
}
5052
.id(cmd.id)
53+
VStack(alignment: .leading) {
54+
Text("Command")
55+
TextEditor(text: $execute)
56+
.font(.system(.body, design: .monospaced))
57+
.frame(height: 100)
58+
}
59+
.padding()
5160
}
5261
}
5362

0 commit comments

Comments
 (0)