Skip to content

Commit

Permalink
Move computer information to bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-bovet committed May 9, 2021
1 parent ce7ad22 commit 47a79cf
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions Shared/Views/InformationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,33 @@ struct InformationView: View {
if let opening = document.engine.openingName() {
Text(opening)
.padding(.bottom)
} else {
if document.state == .play {
HStack() {
Image(systemName: "cpu")
Text(value())
}
.padding(.bottom)
HStack {
Text(Image(systemName: "speedometer"))
Text(speed())
}
.padding(.bottom)
}
}
Text(document.engine.pgnFormattedForDisplay())
Spacer()
if document.state == .play {
HStack() {
Image(systemName: "cpu")
Text(value())
}
.padding(.bottom)
HStack {
Text(Image(systemName: "speedometer"))
Text(speed())
}
}
}
}
}

struct BottomInformationView_Previews: PreviewProvider {
static var previews: some View {
let doc = ChessDocument(pgn: "1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nc3 dxe5 *")
InformationView(document: doc)
Group {
let doc = ChessDocument(pgn: "1. e4 e5 *")
InformationView(document: doc)
}
Group {
let doc = ChessDocument(pgn: "1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nc3 dxe5 *")
InformationView(document: doc)
}
}
}

0 comments on commit 47a79cf

Please sign in to comment.