2023-04-19 12:39:50 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
2023-08-10 12:23:59 +00:00
|
|
|
import Qt.labs.settings 1.0
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-04-19 12:39:50 +00:00
|
|
|
import Models 1.0
|
|
|
|
import Storybook 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.controls 1.0
|
2023-04-19 12:39:50 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: networksModel
|
|
|
|
|
|
|
|
readonly property var modelData: [
|
|
|
|
{
|
|
|
|
name: "Optimism",
|
2024-10-15 19:26:12 +00:00
|
|
|
icon: Theme.svg(ModelsData.networks.optimism),
|
2023-08-10 12:23:59 +00:00
|
|
|
amount: "300",
|
|
|
|
multiplierIndex: 0,
|
2024-03-05 14:12:03 +00:00
|
|
|
infiniteAmount: false,
|
|
|
|
decimals: 6
|
2023-04-19 12:39:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Arbitrum",
|
2024-10-15 19:26:12 +00:00
|
|
|
icon: Theme.svg(ModelsData.networks.arbitrum),
|
2023-08-10 12:23:59 +00:00
|
|
|
amount: "400000",
|
|
|
|
multiplierIndex: 3,
|
2024-03-05 14:12:03 +00:00
|
|
|
infiniteAmount: false,
|
|
|
|
decimals: 9
|
2023-04-19 12:39:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Hermez",
|
2024-10-15 19:26:12 +00:00
|
|
|
icon: Theme.svg(ModelsData.networks.hermez),
|
2023-08-10 12:23:59 +00:00
|
|
|
amount: "0",
|
|
|
|
multiplierIndex: 0,
|
2024-03-05 14:12:03 +00:00
|
|
|
infiniteAmount: true,
|
|
|
|
decimals: 0
|
2023-08-10 12:23:59 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Ethereum",
|
2024-10-15 19:26:12 +00:00
|
|
|
icon: Theme.svg(ModelsData.networks.ethereum),
|
2023-08-10 12:23:59 +00:00
|
|
|
amount: "12" + "0".repeat(18),
|
|
|
|
multiplierIndex: 18,
|
2024-03-05 14:12:03 +00:00
|
|
|
infiniteAmount: false,
|
|
|
|
decimals: 9
|
2023-04-19 12:39:50 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
Component.onCompleted: append(modelData)
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: container
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: tokenPanel
|
|
|
|
border.width: 1
|
|
|
|
anchors.margins: -15
|
|
|
|
}
|
|
|
|
|
|
|
|
TokenPanel {
|
|
|
|
id: tokenPanel
|
|
|
|
|
|
|
|
mode: {
|
|
|
|
if (addRadioButton.checked)
|
|
|
|
return HoldingTypes.Mode.Add
|
|
|
|
else if (updateRadioButton.checked)
|
|
|
|
return HoldingTypes.Mode.Update
|
|
|
|
else
|
|
|
|
return HoldingTypes.Mode.UpdateOrRemove
|
|
|
|
}
|
|
|
|
|
|
|
|
tokenCategoryText: "Community asset"
|
|
|
|
tokenName: "Token name"
|
|
|
|
tokenShortName: "TN"
|
|
|
|
tokenAmount: amountTextField.text
|
|
|
|
tokenImage: ModelsData.assets.socks
|
|
|
|
|
|
|
|
networksModel: networksModelCheckBox.checked ? networksModel : null
|
|
|
|
|
|
|
|
width: 300
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
RowLayout {
|
|
|
|
RadioButton {
|
|
|
|
id: addRadioButton
|
|
|
|
text: "Add"
|
|
|
|
|
|
|
|
checked: true
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
id: updateRadioButton
|
|
|
|
text: "Update"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: updateOrRemoveRadioButton
|
|
|
|
text: "Update or remove"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: networksModelCheckBox
|
|
|
|
|
|
|
|
text: "Networks model"
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Label {
|
|
|
|
text: "Amount:"
|
|
|
|
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: amountTextField
|
|
|
|
|
|
|
|
text: "∞"
|
|
|
|
}
|
2024-03-05 14:12:03 +00:00
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Decimals:"
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: decimalsTextField
|
|
|
|
|
|
|
|
text: "0"
|
|
|
|
}
|
2023-04-19 12:39:50 +00:00
|
|
|
}
|
2023-08-10 12:23:59 +00:00
|
|
|
|
2024-03-05 14:12:03 +00:00
|
|
|
RowLayout {
|
|
|
|
Label {
|
|
|
|
text: "amount: " + tokenPanel.amount
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: "decimals: " + tokenPanel.decimals
|
|
|
|
}
|
2023-08-10 12:23:59 +00:00
|
|
|
}
|
2023-04-19 12:39:50 +00:00
|
|
|
}
|
|
|
|
}
|
2023-08-10 12:23:59 +00:00
|
|
|
|
|
|
|
Settings {
|
|
|
|
property alias networksModelCheckBoxChecked:
|
|
|
|
networksModelCheckBox.checked
|
|
|
|
}
|
2023-04-19 12:39:50 +00:00
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Panels
|