feat(wallet) customize NetworkFilter for dapps display
Allow to show all selected icons in the network filter Hide checkboxes in the network filter dropdown Updates #14607
This commit is contained in:
parent
7cd97a0051
commit
4771f0d77f
|
@ -25,6 +25,8 @@ StatusComboBox {
|
||||||
property bool multiSelection: true
|
property bool multiSelection: true
|
||||||
property bool preferredNetworksMode: false
|
property bool preferredNetworksMode: false
|
||||||
property var preferredSharingNetworks: []
|
property var preferredSharingNetworks: []
|
||||||
|
property bool showAllSelectedText: true
|
||||||
|
property bool showCheckboxes: true
|
||||||
|
|
||||||
/// \c network is a network.model.nim entry
|
/// \c network is a network.model.nim entry
|
||||||
/// It is called for every toggled network if \c multiSelection is \c true
|
/// It is called for every toggled network if \c multiSelection is \c true
|
||||||
|
@ -101,13 +103,13 @@ StatusComboBox {
|
||||||
lineHeight: 24
|
lineHeight: 24
|
||||||
lineHeightMode: Text.FixedHeight
|
lineHeightMode: Text.FixedHeight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
text: root.multiSelection ? (d.noneSelected ? qsTr("Select networks"): d.allSelected ? qsTr("All networks") : "") : d.selectedChainName
|
text: root.multiSelection ? (d.noneSelected ? qsTr("Select networks"): d.allSelected && root.showAllSelectedText ? qsTr("All networks") : "") : d.selectedChainName
|
||||||
color: Theme.palette.baseColor1
|
color: Theme.palette.baseColor1
|
||||||
visible: !!text
|
visible: !!text
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
spacing: -4
|
spacing: -4
|
||||||
visible: !d.allSelected && chainRepeater.count > 0
|
visible: (!d.allSelected || !root.showAllSelectedText) && chainRepeater.count > 0
|
||||||
Repeater {
|
Repeater {
|
||||||
id: chainRepeater
|
id: chainRepeater
|
||||||
model: root.preferredNetworksMode ? root.flatNetworks: root.multiSelection ? d.enabledFlatNetworks: []
|
model: root.preferredNetworksMode ? root.flatNetworks: root.multiSelection ? d.enabledFlatNetworks: []
|
||||||
|
@ -126,6 +128,7 @@ StatusComboBox {
|
||||||
flatNetworks: root.flatNetworks
|
flatNetworks: root.flatNetworks
|
||||||
preferredSharingNetworks: root.preferredSharingNetworks
|
preferredSharingNetworks: root.preferredSharingNetworks
|
||||||
preferredNetworksMode: root.preferredNetworksMode
|
preferredNetworksMode: root.preferredNetworksMode
|
||||||
|
showCheckboxes: root.showCheckboxes
|
||||||
|
|
||||||
implicitWidth: contentWidth
|
implicitWidth: contentWidth
|
||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
|
|
|
@ -15,6 +15,7 @@ StatusListItem {
|
||||||
property var singleSelection
|
property var singleSelection
|
||||||
property var radioButtonGroup
|
property var radioButtonGroup
|
||||||
property bool useEnabledRole: true
|
property bool useEnabledRole: true
|
||||||
|
property bool showCheckboxes: true
|
||||||
|
|
||||||
// Needed for preferred sharing networks
|
// Needed for preferred sharing networks
|
||||||
property bool preferredNetworksMode: false
|
property bool preferredNetworksMode: false
|
||||||
|
@ -49,7 +50,7 @@ StatusListItem {
|
||||||
id: checkBox
|
id: checkBox
|
||||||
objectName: "networkSelectionCheckbox_" + model.chainName
|
objectName: "networkSelectionCheckbox_" + model.chainName
|
||||||
tristate: true
|
tristate: true
|
||||||
visible: !root.singleSelection.enabled
|
visible: !root.singleSelection.enabled && root.showCheckboxes
|
||||||
|
|
||||||
checkState: {
|
checkState: {
|
||||||
if(root.preferredNetworksMode) {
|
if(root.preferredNetworksMode) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ StatusListView {
|
||||||
property SingleSelectionInfo singleSelection: SingleSelectionInfo {}
|
property SingleSelectionInfo singleSelection: SingleSelectionInfo {}
|
||||||
property var preferredSharingNetworks: []
|
property var preferredSharingNetworks: []
|
||||||
property bool preferredNetworksMode: false
|
property bool preferredNetworksMode: false
|
||||||
|
property bool showCheckboxes: true
|
||||||
|
|
||||||
signal toggleNetwork(var network, int index)
|
signal toggleNetwork(var network, int index)
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ StatusListView {
|
||||||
preferredNetworksMode: root.preferredNetworksMode
|
preferredNetworksMode: root.preferredNetworksMode
|
||||||
preferredSharingNetworks: root.preferredSharingNetworks
|
preferredSharingNetworks: root.preferredSharingNetworks
|
||||||
allChecked: root.preferredSharingNetworks.length === root.count
|
allChecked: root.preferredSharingNetworks.length === root.count
|
||||||
|
showCheckboxes: root.showCheckboxes
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
|
|
Loading…
Reference in New Issue