2023-07-20 10:38:49 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2024-06-07 12:27:56 +00:00
|
|
|
import shared.controls 1.0
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property alias generalErrorText: generalErrorText.text
|
|
|
|
|
|
|
|
property bool showTotal: true
|
|
|
|
property alias totalFeeText: feeTotalRow.feeText
|
|
|
|
|
2023-07-25 13:55:06 +00:00
|
|
|
readonly property alias accountsSelector: accountSelector
|
|
|
|
property bool showAccountsSelector: true
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
property alias accountErrorText: accountErrorText.text
|
|
|
|
|
2023-09-25 15:03:35 +00:00
|
|
|
required property string accountSelectorText
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
component Separator: Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 1
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.padding
|
2023-07-20 10:38:49 +00:00
|
|
|
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
}
|
|
|
|
|
|
|
|
component ErrorText: StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.halfPadding
|
2023-07-20 10:38:49 +00:00
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
|
|
|
|
font.pixelSize: Theme.tertiaryTextFontSize
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
ErrorText {
|
|
|
|
id: generalErrorText
|
|
|
|
|
|
|
|
visible: text !== ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
visible: root.showTotal
|
|
|
|
}
|
|
|
|
|
|
|
|
FeeRow {
|
|
|
|
id: feeTotalRow
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.padding
|
2023-07-20 10:38:49 +00:00
|
|
|
|
|
|
|
title: qsTr("Total")
|
|
|
|
highlightFee: true
|
|
|
|
visible: root.showTotal
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
visible: accountSelector.visible
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.padding
|
2023-07-20 10:38:49 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
visible: accountSelector.visible
|
2023-09-25 15:03:35 +00:00
|
|
|
text: root.accountSelectorText
|
2023-07-20 10:38:49 +00:00
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
|
|
|
lineHeight: 1.2
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
AccountSelector {
|
|
|
|
id: accountSelector
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.halfPadding
|
2023-07-20 10:38:49 +00:00
|
|
|
|
2023-07-25 13:55:06 +00:00
|
|
|
visible: root.showAccountsSelector
|
2023-07-25 14:03:18 +00:00
|
|
|
forceError: accountErrorText.visible
|
2023-07-20 10:38:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorText {
|
|
|
|
id: accountErrorText
|
|
|
|
|
|
|
|
visible: accountSelector.visible && text !== ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|