Skip to content

Commit 64a16d5

Browse files
committed
qml: Add Multiple Recipients bar to Send form
1 parent c84430e commit 64a16d5

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

src/qml/controls/SendOptionsPopup.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ OptionPopup {
4545
text: qsTr("Multiple Recipients")
4646
}
4747
}
48-
}
48+
}

src/qml/models/walletqmlmodel.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,13 @@ std::vector<COutPoint> WalletQmlModel::listSelectedCoins() const
204204
{
205205
return m_coin_control.ListSelected();
206206
}
207+
208+
int WalletQmlModel::recipientIndex() const
209+
{
210+
return 1;
211+
}
212+
213+
int WalletQmlModel::recipientsCount() const
214+
{
215+
return 1;
216+
}

src/qml/models/walletqmlmodel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class WalletQmlModel : public QObject
2828
Q_PROPERTY(CoinsListModel* coinsListModel READ coinsListModel CONSTANT)
2929
Q_PROPERTY(SendRecipient* sendRecipient READ sendRecipient CONSTANT)
3030
Q_PROPERTY(WalletQmlModelTransaction* currentTransaction READ currentTransaction NOTIFY currentTransactionChanged)
31+
Q_PROPERTY(int recipientIndex READ recipientIndex NOTIFY recipientIndexChanged)
32+
Q_PROPERTY(int recipientsCount READ recipientsCount NOTIFY recipientsCountChanged)
3133

3234
public:
3335
WalletQmlModel(std::unique_ptr<interfaces::Wallet> wallet, QObject* parent = nullptr);
@@ -64,10 +66,15 @@ class WalletQmlModel : public QObject
6466
bool isSelectedCoin(const COutPoint& output);
6567
std::vector<COutPoint> listSelectedCoins() const;
6668

69+
int recipientIndex() const;
70+
int recipientsCount() const;
71+
6772
Q_SIGNALS:
6873
void nameChanged();
6974
void balanceChanged();
7075
void currentTransactionChanged();
76+
void recipientIndexChanged();
77+
void recipientsCountChanged();
7178

7279
private:
7380
std::unique_ptr<interfaces::Wallet> m_wallet;

src/qml/pages/wallet/Send.qml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,34 @@ PageStack {
8181
}
8282
}
8383

84+
RowLayout {
85+
id: selectAndAddRecipients
86+
Layout.fillWidth: true
87+
Layout.topMargin: 10
88+
Layout.bottomMargin: 10
89+
visible: settings.multipleRecipientsEnabled
90+
91+
NavButton {
92+
iconSource: "image://images/caret-left"
93+
}
94+
95+
NavButton {
96+
iconSource: "image://images/caret-right"
97+
}
98+
99+
CoreText {
100+
id: selectAndAddRecipientsLabel
101+
text: qsTr("Recipient %1 of %2").arg(wallet.recipientIndex).arg(wallet.recipientsCount)
102+
font.pixelSize: 18
103+
color: Theme.color.neutral9
104+
}
105+
}
106+
107+
Separator {
108+
visible: settings.multipleRecipientsEnabled
109+
Layout.fillWidth: true
110+
}
111+
84112
LabeledTextInput {
85113
id: address
86114
Layout.fillWidth: true

0 commit comments

Comments
 (0)