From 47a79cff957151deee16739095420696ac051572 Mon Sep 17 00:00:00 2001 From: Jean Bovet Date: Sun, 9 May 2021 08:51:10 -0700 Subject: [PATCH] Move computer information to bottom --- Shared/Views/InformationView.swift | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Shared/Views/InformationView.swift b/Shared/Views/InformationView.swift index 79fe5cc..9939f91 100644 --- a/Shared/Views/InformationView.swift +++ b/Shared/Views/InformationView.swift @@ -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) + } } }