Skip to content

Commit 716027c

Browse files
committed
qml: make entire peers page scrollable
1 parent 23a1ab4 commit 716027c

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

src/qml/pages/node/Peers.qml

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -16,87 +16,87 @@ Page {
1616
id: navbar
1717
}
1818

19-
CoreText {
20-
anchors.top: parent.top
21-
anchors.horizontalCenter: parent.horizontalCenter
22-
id: description
23-
width: Math.min(parent.width - 40, 450)
24-
text: qsTr("Peers are nodes you are connected to. You want to ensure that you are connected" +
25-
" to x, y and z, but not a, b, and c. Learn more.")
26-
font.pixelSize: 13
27-
color: Theme.color.neutral7
28-
}
29-
30-
Flickable {
31-
id: sortSelection
32-
anchors.top: description.bottom
33-
anchors.topMargin: 20
34-
anchors.horizontalCenter: parent.horizontalCenter
35-
width: Math.min(parent.width - 40, toggleButtons.width)
36-
height: toggleButtons.height
37-
contentWidth: toggleButtons.width
38-
boundsMovement: width == toggleButtons.width ?
39-
Flickable.StopAtBounds : Flickable.FollowBoundsBehavior
40-
RowLayout {
41-
id: toggleButtons
42-
spacing: 10
43-
ToggleButton {
44-
text: qsTr("ID")
45-
autoExclusive: true
46-
checked: true
47-
onClicked: {
48-
peerListModelProxy.sortBy = "nodeId"
49-
}
50-
}
51-
ToggleButton {
52-
text: qsTr("Direction")
53-
autoExclusive: true
54-
onClicked: {
55-
peerListModelProxy.sortBy = "direction"
56-
}
57-
}
58-
ToggleButton {
59-
text: qsTr("User Agent")
60-
autoExclusive: true
61-
onClicked: {
62-
peerListModelProxy.sortBy = "subversion"
63-
}
64-
}
65-
ToggleButton {
66-
text: qsTr("Type")
67-
autoExclusive: true
68-
onClicked: {
69-
peerListModelProxy.sortBy = "connectionType"
70-
}
71-
}
72-
ToggleButton {
73-
text: qsTr("Ip")
74-
autoExclusive: true
75-
onClicked: {
76-
peerListModelProxy.sortBy = "address"
77-
}
78-
}
79-
ToggleButton {
80-
text: qsTr("Network")
81-
autoExclusive: true
82-
onClicked: {
83-
peerListModelProxy.sortBy = "network"
84-
}
85-
}
86-
}
87-
}
88-
8919
ListView {
9020
id: listView
9121
clip: true
9222
width: Math.min(parent.width - 40, 450)
93-
anchors.top: sortSelection.bottom
94-
anchors.topMargin: 30
95-
anchors.bottom: parent.bottom
23+
height: parent.height
9624
anchors.horizontalCenter: parent.horizontalCenter
9725
model: peerListModelProxy
9826
spacing: 15
9927

28+
header: ColumnLayout {
29+
spacing: 20
30+
width: parent.width
31+
CoreText {
32+
id: description
33+
Layout.fillWidth: true
34+
Layout.alignment: Qt.AlignHCenter
35+
text: qsTr("Peers are nodes you are connected to. You want to ensure that you are connected" +
36+
" to x, y and z, but not a, b, and c. Learn more.")
37+
font.pixelSize: 13
38+
color: Theme.color.neutral7
39+
}
40+
41+
Flickable {
42+
id: sortSelection
43+
Layout.fillWidth: true
44+
Layout.bottomMargin: 30
45+
Layout.alignment: Qt.AlignHCenter
46+
height: toggleButtons.height
47+
contentWidth: toggleButtons.width
48+
boundsMovement: width == toggleButtons.width ?
49+
Flickable.StopAtBound : Flickable.FollowBoundsBehavior
50+
RowLayout {
51+
id: toggleButtons
52+
spacing: 10
53+
ToggleButton {
54+
text: qsTr("ID")
55+
autoExclusive: true
56+
checked: true
57+
onClicked: {
58+
peerListModelProxy.sortBy = "nodeId"
59+
}
60+
}
61+
ToggleButton {
62+
text: qsTr("Direction")
63+
autoExclusive: true
64+
onClicked: {
65+
peerListModelProxy.sortBy = "direction"
66+
}
67+
}
68+
ToggleButton {
69+
text: qsTr("User Agent")
70+
autoExclusive: true
71+
onClicked: {
72+
peerListModelProxy.sortBy = "subversion"
73+
}
74+
}
75+
ToggleButton {
76+
text: qsTr("Type")
77+
autoExclusive: true
78+
onClicked: {
79+
peerListModelProxy.sortBy = "connectionType"
80+
}
81+
}
82+
ToggleButton {
83+
text: qsTr("Ip")
84+
autoExclusive: true
85+
onClicked: {
86+
peerListModelProxy.sortBy = "address"
87+
}
88+
}
89+
ToggleButton {
90+
text: qsTr("Network")
91+
autoExclusive: true
92+
onClicked: {
93+
peerListModelProxy.sortBy = "network"
94+
}
95+
}
96+
}
97+
}
98+
}
99+
100100
footer: Loader {
101101
height: 75
102102
active: nodeModel.numOutboundPeers < nodeModel.maxNumOutboundPeers

0 commit comments

Comments
 (0)