Skip to content

Commit

Permalink
Move new track buttons to new section
Browse files Browse the repository at this point in the history
It could be a bit difficult or confusing to move tracks to the bottom of the list when the new track buttons were in the same section.
  • Loading branch information
skjiisa committed Jun 1, 2021
1 parent 4369417 commit a7a4257
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Tickmate/Tickmate/Views/TracksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ struct TracksView: View {
.onMove(perform: move)
.animation(.easeInOut(duration: 0.25))

Button("Create new track") {
let newTrack = trackController.newTrack(index: (tracks.last?.index ?? -1) + 1, context: moc)
select(track: newTrack, delay: 0.25)
}
.centered()
.foregroundColor(.accentColor)

Button("Add preset track") {
showingPresets = true
Section {
Button("Create new track") {
let newTrack = trackController.newTrack(index: (tracks.last?.index ?? -1) + 1, context: moc)
select(track: newTrack, delay: 0.25)
}
.centered()
.foregroundColor(.accentColor)

Button("Add preset track") {
showingPresets = true
}
.centered()
.foregroundColor(.accentColor)
}
.centered()
.foregroundColor(.accentColor)
}
.environment(\.editMode, $editMode)
.navigationTitle("Tracks")
Expand Down

0 comments on commit a7a4257

Please sign in to comment.