2023-04-19 12:05:47 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2023-04-26 15:53:49 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
2023-04-19 12:05:47 +00:00
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-04-19 12:05:47 +00:00
|
|
|
import AppLayouts.Wallet.controls 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
2023-06-13 13:54:51 +00:00
|
|
|
Logs { id: logs }
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-09-12 09:26:25 +00:00
|
|
|
readonly property string ethereumName : "Ethereum Mainnet"
|
|
|
|
readonly property string optimismName : "Optimism"
|
|
|
|
readonly property string arbitrumName : "Arbitrum"
|
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
SplitView {
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
orientation: Qt.Vertical
|
2023-04-19 12:05:47 +00:00
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
Item {
|
|
|
|
id: container
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
Rectangle {
|
|
|
|
width: 800
|
|
|
|
height: 200
|
|
|
|
border.width: 1
|
2023-04-19 12:05:47 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
NetworkFilter {
|
|
|
|
id: networkFilter
|
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
flatNetworks: SortFilterProxyModel {
|
|
|
|
sourceModel: NetworksModel.flatNetworks
|
|
|
|
filters: ValueFilter { roleName: "isTest"; value: false; }
|
|
|
|
}
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
multiSelection: multiSelectionCheckBox.checked
|
|
|
|
|
2023-09-12 09:26:25 +00:00
|
|
|
onToggleNetwork: {
|
|
|
|
|
|
|
|
logs.logEvent("onToggleNetwork: " + network.chainName)
|
|
|
|
if(network.chainName === root.ethereumName)
|
|
|
|
ethRadioBtn.checked = true
|
|
|
|
|
|
|
|
else if(network.chainName === root.optimismName)
|
|
|
|
optRadioBtn.checked = true
|
|
|
|
|
|
|
|
else if(network.chainName === root.arbitrumName)
|
|
|
|
arbRadioBtn.checked = true
|
|
|
|
}
|
2023-06-13 13:54:51 +00:00
|
|
|
}
|
2023-04-19 12:05:47 +00:00
|
|
|
}
|
|
|
|
}
|
2023-06-13 13:54:51 +00:00
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
}
|
2023-04-19 12:05:47 +00:00
|
|
|
}
|
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
ColumnLayout {
|
|
|
|
spacing: 16
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: multiSelectionCheckBox
|
|
|
|
text: "Multi selection"
|
|
|
|
checked: true
|
|
|
|
onCheckedChanged: if(!checked) ethRadioBtn.checked = true
|
|
|
|
}
|
2023-04-19 12:05:47 +00:00
|
|
|
|
2023-06-13 13:54:51 +00:00
|
|
|
ColumnLayout {
|
|
|
|
visible: !multiSelectionCheckBox.checked
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Chain Id:"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: ethRadioBtn
|
|
|
|
|
2023-09-12 09:26:25 +00:00
|
|
|
text: root.ethereumName
|
2023-06-13 13:54:51 +00:00
|
|
|
onCheckedChanged: if(checked) networkFilter.setChain(NetworksModel.ethNet)
|
|
|
|
}
|
|
|
|
RadioButton {
|
2023-09-12 09:26:25 +00:00
|
|
|
id: optRadioBtn
|
|
|
|
|
|
|
|
text: root.optimismName
|
2023-06-13 13:54:51 +00:00
|
|
|
onCheckedChanged: if(checked) networkFilter.setChain(NetworksModel.optimismNet)
|
|
|
|
}
|
|
|
|
RadioButton {
|
2023-09-12 09:26:25 +00:00
|
|
|
id: arbRadioBtn
|
|
|
|
|
|
|
|
text: root.arbitrumName
|
2023-06-13 13:54:51 +00:00
|
|
|
onCheckedChanged: if(checked) networkFilter.setChain(NetworksModel.arbitrumNet)
|
|
|
|
}
|
|
|
|
}
|
2023-04-19 12:05:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Components
|
2024-04-10 14:07:56 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/FkFClTCYKf83RJWoifWgoX/Wallet-v2?type=design&node-id=13179-346563&mode=design&t=RUkJVqqhgam32C1S-0
|