--- a/TalerWallet1/Views/HelperViews/ScopePicker.swift +++ b/TalerWallet1/Views/HelperViews/ScopePicker.swift @@ -66,17 +66,32 @@ @State private var selected = 0 + private func title(_ exchange: DefaultExchange) -> String { + exchange.talerUri.contains("exchange.stage.taler-ops.ch") ? exchange.currencySpec.name + " (stage)" + : exchange.currencySpec.name + } + var body: some View { - Picker(EMPTYSTRING, selection: $selected) { - ForEachWithIndex(array: exchanges) { index, exchange in - if exchange.talerUri.contains("exchange.stage.taler-ops.ch") { - Text(exchange.currencySpec.name + " (stage)") - .tag(index) - } else { - Text(exchange.currencySpec.name) + // a Menu with a Text as its label, not a bare Picker: the label of a menu-style Picker is a + // single line which the system truncates in the middle ("Swis…rancs" at the largest text sizes) + Menu { + Picker(EMPTYSTRING, selection: $selected) { + ForEachWithIndex(array: exchanges) { index, exchange in + Text(title(exchange)) .tag(index) } } + } label: { + HStack(alignment: .firstTextBaseline) { + if selected < exchanges.count { + Text(title(exchanges[selected])) + .multilineTextAlignment(.leading) + .fixedSize(horizontal: false, vertical: true) + } + Image(systemName: "chevron.up.chevron.down") + .imageScale(.small) + .accessibilityHidden(true) + } } .talerFont(.title3) .task() {