Skip to content

Commit

Permalink
Merge pull request #1 from NickCulbertson/main
Browse files Browse the repository at this point in the history
Add border to keys
  • Loading branch information
aure authored Aug 2, 2022
2 parents 92895f2 + 236ef56 commit 575b78e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/Audulus/Tonic.git",
"state": {
"branch": "main",
"revision": "121693a1fbee5aeb0bf065a97cc086f2c7c95017",
"revision": "1ce32a88caf64d857cef720cad00c990b135f30b",
"version": null
}
}
Expand Down
14 changes: 7 additions & 7 deletions Sources/Keyboard/Keyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public struct Keyboard<Content>: View where Content: View {
}

var isomorphicBody: some View {
HStack(spacing: 1) {
HStack(spacing: 0) {
ForEach(pitchRange, id: \.self) { pitch in
KeyContainer(model: model,
pitch: pitch,
Expand All @@ -66,12 +66,12 @@ public struct Keyboard<Content>: View where Content: View {
content: content)
}
}
.frame(minWidth: 600, minHeight: 100)
.frame(minWidth: 100, minHeight: 100)
.clipShape(Rectangle())
}

var pianoRollBody: some View {
VStack(spacing: 1) {
VStack(spacing: 0) {
ForEach(pitchRange, id: \.self) { pitch in
KeyContainer(model: model,
pitch: pitch,
Expand All @@ -82,15 +82,15 @@ public struct Keyboard<Content>: View where Content: View {
content: content)
}
}
.frame(minWidth: 100, minHeight: 600)
.frame(minWidth: 100, minHeight: 100)
.clipShape(Rectangle())
}


var pianoBody: some View {

ZStack {
HStack(spacing: 1) {
HStack(spacing: 0) {
ForEach(whiteKeys, id: \.self) { pitch in
KeyContainer(model: model,
pitch: pitch,
Expand All @@ -101,7 +101,7 @@ public struct Keyboard<Content>: View where Content: View {
}
}
VStack {
HStack(spacing: 1) {
HStack(spacing: 0) {
ForEach(whiteKeys, id: \.self) { pitch in
KeyContainer(model: model,
pitch: Pitch(intValue: pitch.intValue + 1),
Expand All @@ -115,7 +115,7 @@ public struct Keyboard<Content>: View where Content: View {
Spacer()
}
}
.frame(minWidth: 600, minHeight: 100)
.frame(minWidth: 100, minHeight: 100)
.clipShape(Rectangle())
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/Keyboard/KeyboardKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public struct KeyboardKey: View {
RoundedRectangle(cornerSize: CGSize(width: minDimension(proxy.size) / 8.0,
height: minDimension(proxy.size) / 8.0))
.foregroundColor(keyColor)
.overlay(RoundedRectangle(cornerRadius: minDimension(proxy.size) / 8.0)
.strokeBorder(Color.black, lineWidth: 0.5))
Text(text)
.font(Font(.init(.system, size: minDimension(proxy.size) / 3)))
.foregroundColor(textColor)
Expand Down

0 comments on commit 575b78e

Please sign in to comment.