diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift index ea15087e..3b945a27 100644 --- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift +++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift @@ -89,6 +89,30 @@ struct WireTransferView: View { let amountStr = transferAmount.formatted(specs: specs, isNegative: false, scope: account.scope) let amountValue = transferAmount.valueStr // let _ = print(amountStr, " | ", obtainStr) + let countA = transferOptions.count + let countB = firstOption.qrCodes?.count ?? 0 + // Inline, as opposed to behind the "Wire transfer QR codes" + // link: exactly one code to show. + let showsInlineQR = !(countA > 1 || countB > 1) && countB > 0 + && firstOption.paytoUri != nil + // The QR code is what this screen is for, so it goes first. + // + // It used to come last, after the title, the amount and the + // "Wire transfer instructions" link -- and a QR code is drawn + // at a fixed 276pt, so by then it started below the fold: the + // floating "Done" bar lay across its lower edge and the window + // cut off the rest. A code that has to be scrolled into view + // before it can be scanned, with nothing on screen saying so, + // is a code the user does not know is there. + if showsInlineQR { + Group { + Text("If your banking software runs on another device, you can scan this QR code:") + .listRowSeparator(.hidden) + QRcodeCopyShare(stack: stack.push(), option: firstOption) + .listRowSeparator(.automatic) + }.id(listID) + .talerFont(.body) + } if !minimalistic { Text(title) .talerFont(.headline) @@ -116,9 +140,6 @@ struct WireTransferView: View { .accessibilityLabel(amountStr.1) } - let countA = transferOptions.count - let countB = firstOption.qrCodes?.count ?? 0 - if let paytoUri = firstOption.paytoUri { let payto = PayTo(paytoUri) if let receiverStr = payto.receiver { @@ -139,14 +160,11 @@ struct WireTransferView: View { .talerFont(.title3) } + // The single-code case is drawn at the top of the + // list instead; several codes stay behind a link. Group { if countA > 1 || countB > 1 { qrCodesRow(transferOptions) - } else if countB > 0 { // show the single QR directly - Text("If your banking software runs on another device, you can scan this QR code:") - .listRowSeparator(.hidden) - QRcodeCopyShare(stack: stack.push(), option: firstOption) - .listRowSeparator(.automatic) } }.id(listID) .talerFont(.body)