Warning, /plasma/plasma-desktop/kcms/gamecontroller/ui/Table.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import QtQuick.Controls as QQC2
0009 
0010 import org.kde.kirigami as Kirigami
0011 
0012 Rectangle {
0013     id: root
0014 
0015     property alias model: buttonTable.model
0016     property string textRole: "display"
0017 
0018     border {
0019         color: Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, 0.2)
0020         width: 1
0021     }
0022 
0023     radius: Kirigami.Units.smallSpacing
0024     color: "transparent"
0025 
0026     Kirigami.Theme.colorSet: Kirigami.Theme.Window
0027     Kirigami.Theme.inherit: false
0028 
0029     QQC2.HorizontalHeaderView {
0030         id: buttonHorizontalHeader
0031 
0032         anchors {
0033             left: buttonTable.left
0034             top: parent.top
0035             topMargin: 1
0036         }
0037 
0038         syncView: buttonTable
0039         clip: true
0040     }
0041 
0042     QQC2.VerticalHeaderView {
0043         id: buttonVerticalHeader
0044 
0045         anchors {
0046             top: buttonTable.top
0047             left: parent.left
0048             leftMargin: 1
0049         }
0050 
0051         syncView: buttonTable
0052         clip: true
0053     }
0054 
0055     TableView {
0056         id: buttonTable
0057 
0058         anchors {
0059             left: buttonVerticalHeader.right
0060             top: buttonHorizontalHeader.bottom
0061             right: parent.right
0062             rightMargin: 1
0063             bottom: parent.bottom
0064             bottomMargin: 1
0065         }
0066 
0067         columnSpacing: 0
0068         rowSpacing: 1
0069         clip: true
0070         resizableRows: false
0071         resizableColumns: false
0072         alternatingRows: false
0073         boundsBehavior: Flickable.StopAtBounds
0074         selectionBehavior: TableView.SelectionDisabled
0075         pointerNavigationEnabled: false
0076 
0077         delegate: QQC2.ItemDelegate {
0078             implicitWidth: TableView.view.width
0079 
0080             text: model[root.textRole]
0081 
0082             Kirigami.Theme.colorSet: Kirigami.Theme.View
0083             Kirigami.Theme.inherit: false
0084         }
0085 
0086         QQC2.ScrollBar.vertical: QQC2.ScrollBar {}
0087         QQC2.ScrollBar.horizontal: QQC2.ScrollBar {}
0088     }
0089 }