...
1import QtQuick 2.12
2import QtQuick.Controls 2.15 as QQC2
3
4import org.kde.kirigami 2.7 as Kirigami
5import org.kde.kcm 1.2
6import org.kde.kinfocenter.nic.private 1.0
7
8ScrollViewKCM {
9 ConfigModule.quickHelp: i18n("Network Information")
10 clip: true
11
12 view: TableView {
13 id: tableview
14 clip: true
15
16 columnWidthProvider: function (column) {
17 return tableview.model ? tableview.width / tableview.model.columnCount() : 0
18 }
19
20 model: NetworkModel {
21 id: model
22 }
23
24 delegate: Rectangle {
25 readonly property real cellPadding: 8
26 readonly property color borderColor: Kirigami.Theme.Color
27 color: row % 2 === 0 ? "transparent" : Kirigami.Theme.alternateBackgroundColor
28
29 implicitWidth: tableview.width / tableview.model.columnCount()
30 implicitHeight: text.contentHeight + Kirigami.Units.largeSpacing
31
32 Text {
33 id: text
34 text: display
35 x: Kirigami.Units.smallSpacing
36 width: parent.width - Kirigami.Units.largeSpacing
37 height: parent.height
38 horizontalAlignment: Text.AlignHCenter
39 verticalAlignment: Text.AlignVCenter
40 color: "#ff26282a"
41 wrapMode: Text.WrapAnywhere
42 }
43 }
44
45 topMargin: headerView.implicitHeight
46
47 QQC2.HorizontalHeaderView {
48 id: headerView
49 anchors.bottom: parent.top
50 syncView: tableview
51 }
52 }
53
54 footer: QQC2.Button {
55 text: i18nc("Update the information displayed", "Update")
56 onClicked: model.update();
57 }
58}
59
View as plain text