chore(Communities): Fees box - add showAccountsSelector flag

It allows to show/hide selector without losing it's state.
This commit is contained in:
Michał Cieślak 2023-07-25 15:55:06 +02:00 committed by Michał
parent 7f27695f12
commit 8524e37844
3 changed files with 14 additions and 7 deletions

View File

@ -53,7 +53,10 @@ SplitView {
width: 600
model: filteredModel
accountsModel: accountsSwitch.checked ? accountsModel : null
accountsSelector.model: accountsModel
showAccountsSelector: accountsSwitch.checked
placeholderText: placeholderTextField.text
totalFeeText: totalCheckBox.checked ?

View File

@ -16,7 +16,9 @@ Control {
property bool showTotal: true
property alias totalFeeText: feeTotalRow.feeText
property alias accountsModel: accountSelector.model
readonly property alias accountsSelector: accountSelector
property bool showAccountsSelector: true
property alias accountErrorText: accountErrorText.text
component Separator: Rectangle {
@ -28,7 +30,6 @@ Control {
}
component ErrorText: StatusBaseText {
Layout.fillWidth: true
Layout.topMargin: Style.current.halfPadding
horizontalAlignment: Text.AlignRight
@ -85,7 +86,7 @@ Control {
Layout.fillWidth: true
Layout.topMargin: Style.current.halfPadding
visible: !!model
visible: root.showAccountsSelector
}
ErrorText {

View File

@ -18,8 +18,11 @@ StatusGroupBox {
// feeText (string)
// error (bool), optional
property alias model: feesBox.model
readonly property alias count: feesBox.count
readonly property alias accountsSelector: footer.accountsSelector
property alias showAccountsSelector: footer.showAccountsSelector
property alias accountsModel: footer.accountsModel
property alias placeholderText: feesBox.placeholderText
property alias totalFeeText: footer.totalFeeText
@ -43,8 +46,8 @@ StatusGroupBox {
footer: FeesBoxFooter {
id: footer
visible: !!accountsModel || showTotal
|| root.generalErrorText || root.accountErrorText
visible: feesBox.count && (root.showAccountsSelector || showTotal
|| root.generalErrorText)
showTotal: feesBox.count > 1
}