File: qml.actual

package info (click to toggle)
golang-github-alecthomas-chroma 0.10.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,652 kB
  • sloc: python: 426; javascript: 79; makefile: 34; sh: 32
file content (59 lines) | stat: -rw-r--r-- 1,751 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import QtQuick 2.12
import QtQuick.Controls 2.15 as QQC2

import org.kde.kirigami 2.7 as Kirigami
import org.kde.kcm 1.2
import org.kde.kinfocenter.nic.private 1.0

ScrollViewKCM {
    ConfigModule.quickHelp: i18n("Network Information")
    clip: true
    
    view: TableView {
        id: tableview
        clip: true
        
        columnWidthProvider: function (column) { 
            return tableview.model ? tableview.width / tableview.model.columnCount() : 0
        }

        model: NetworkModel {
            id: model
        }

        delegate: Rectangle {
            readonly property real cellPadding: 8
            readonly property color borderColor: Kirigami.Theme.Color
            color: row % 2 === 0 ? "transparent" : Kirigami.Theme.alternateBackgroundColor
            
            implicitWidth: tableview.width / tableview.model.columnCount()
            implicitHeight: text.contentHeight + Kirigami.Units.largeSpacing
            
            Text {
                id: text
                text: display
                x: Kirigami.Units.smallSpacing
                width: parent.width - Kirigami.Units.largeSpacing
                height: parent.height
                horizontalAlignment: Text.AlignHCenter
                verticalAlignment: Text.AlignVCenter
                color: "#ff26282a"
                wrapMode: Text.WrapAnywhere
            }
        }
        
        topMargin: headerView.implicitHeight
        
        QQC2.HorizontalHeaderView {
            id: headerView
            anchors.bottom: parent.top
            syncView: tableview
        }
    }
    
    footer: QQC2.Button {
        text: i18nc("Update the information displayed", "Update")
        onClicked: model.update();
    }
}