Skip to content

Commit 34706bb

Browse files
committed
qml: Add Multiple Recipients bar to Send form
1 parent 191edb7 commit 34706bb

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

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+
}

qml/models/walletqmlmodel.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,13 @@ std::vector<COutPoint> WalletQmlModel::listSelectedCoins() const
208208
{
209209
return m_coin_control.ListSelected();
210210
}
211+
212+
int WalletQmlModel::recipientIndex() const
213+
{
214+
return 1;
215+
}
216+
217+
int WalletQmlModel::recipientsCount() const
218+
{
219+
return 1;
220+
}

qml/models/walletqmlmodel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class WalletQmlModel : public QObject
3030
Q_PROPERTY(SendRecipient* sendRecipient READ sendRecipient CONSTANT)
3131
Q_PROPERTY(SendRecipientsListModel* recipients READ sendRecipientList CONSTANT)
3232
Q_PROPERTY(WalletQmlModelTransaction* currentTransaction READ currentTransaction NOTIFY currentTransactionChanged)
33+
Q_PROPERTY(int recipientIndex READ recipientIndex NOTIFY recipientIndexChanged)
34+
Q_PROPERTY(int recipientsCount READ recipientsCount NOTIFY recipientsCountChanged)
3335

3436
public:
3537
WalletQmlModel(std::unique_ptr<interfaces::Wallet> wallet, QObject* parent = nullptr);
@@ -66,10 +68,15 @@ class WalletQmlModel : public QObject
6668
bool isSelectedCoin(const COutPoint& output);
6769
std::vector<COutPoint> listSelectedCoins() const;
6870

71+
int recipientIndex() const;
72+
int recipientsCount() const;
73+
6974
Q_SIGNALS:
7075
void nameChanged();
7176
void balanceChanged();
7277
void currentTransactionChanged();
78+
void recipientIndexChanged();
79+
void recipientsCountChanged();
7380

7481
private:
7582
std::unique_ptr<interfaces::Wallet> m_wallet;

qml/pages/wallet/Send.qml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,34 @@ PageStack {
8484
}
8585
}
8686

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

0 commit comments

Comments
 (0)