2024-06-14 12:05:51 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import StatusQ 0.1
|
|
|
|
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
import AppLayouts.Wallet.views 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
id: mainPane
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
Label {
|
|
|
|
text: "Radio Buttons"
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
|
|
|
|
NetworkSelectorView {
|
2024-10-28 12:10:30 +00:00
|
|
|
id: networkSelectorView
|
2024-06-14 12:05:51 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
model: NetworksModel.flatNetworks
|
2024-10-16 20:28:32 +00:00
|
|
|
selection: [11155420]
|
2024-06-14 12:05:51 +00:00
|
|
|
showIndicator: true
|
|
|
|
multiSelection: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Checkboxes"
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
|
|
|
|
NetworkSelectorView {
|
2024-10-28 12:10:30 +00:00
|
|
|
id: networkSelectorView2
|
2024-06-14 12:05:51 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
model: NetworksModel.flatNetworks
|
|
|
|
showIndicator: true
|
|
|
|
multiSelection: true
|
|
|
|
|
2024-10-16 20:28:32 +00:00
|
|
|
selection: [1, 11155420]
|
2024-06-14 12:05:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
id: controls
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
Column {
|
|
|
|
anchors.fill: parent
|
|
|
|
Label {
|
|
|
|
text: "Simulate backend state"
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Radio buttons control"
|
|
|
|
}
|
|
|
|
Repeater {
|
|
|
|
model: NetworksModel.flatNetworks
|
|
|
|
delegate: CheckBox {
|
|
|
|
text: model.chainName
|
2024-10-28 12:10:30 +00:00
|
|
|
checked: networkSelectorView.selection.includes(model.chainId)
|
2024-06-14 12:05:51 +00:00
|
|
|
onToggled: {
|
|
|
|
if (checked) {
|
2024-10-28 12:10:30 +00:00
|
|
|
networkSelectorView.selection = [model.chainId]
|
2024-06-14 12:05:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Checkboxes control"
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: NetworksModel.flatNetworks
|
|
|
|
delegate: CheckBox {
|
|
|
|
text: model.chainName
|
2024-10-28 12:10:30 +00:00
|
|
|
checked: networkSelectorView2.selection.includes(model.chainId)
|
2024-06-14 12:05:51 +00:00
|
|
|
onToggled: {
|
|
|
|
if (checked) {
|
2024-10-28 12:10:30 +00:00
|
|
|
const selection = networkSelectorView2.selection
|
2024-06-14 12:05:51 +00:00
|
|
|
selection.push(model.chainId)
|
2024-10-28 12:10:30 +00:00
|
|
|
networkSelectorView2.selection = selection
|
2024-06-14 12:05:51 +00:00
|
|
|
} else {
|
2024-10-28 12:10:30 +00:00
|
|
|
networkSelectorView2.selection = networkSelectorView2.selection.filter((id) => id !== model.chainId)
|
2024-06-14 12:05:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-16 20:28:32 +00:00
|
|
|
// category: Views
|