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

0001 /*
0002     SPDX-FileCopyrightText: 2018 Tomaz Canabrava <tcanabrava@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 import QtQuick 2.9
0008 import QtQuick.Layouts 1.12
0009 import QtQuick.Window 2.2
0010 import QtQuick.Controls 2.14 as QQC2
0011 import org.kde.kirigami 2.4 as Kirigami
0012 import org.kde.kirigami.delegates as KD
0013 import org.kde.kcmutils as KCM
0014 
0015 KCM.SimpleKCM {
0016     id: root
0017 
0018     implicitWidth: Kirigami.Units.gridUnit * 44
0019     implicitHeight: Kirigami.Units.gridUnit * 25
0020 
0021     property var elements: [
0022         {
0023             icon: "notifications",
0024             title: i18nc("System Bell", "Bell"),
0025             defaultnessKey: "bellIsDefaults"
0026         },
0027         {
0028             icon: "input-keyboard",
0029             title: i18nc("System Modifier Keys", "Modifier Keys"),
0030             defaultnessKey: "keyboardModifiersIsDefaults"
0031         },
0032         {
0033             icon: "view-filter",
0034             title: i18nc("System keyboard filters", "Keyboard Filters"),
0035             defaultnessKey: "keyboardFiltersIsDefaults"
0036         },
0037         {
0038             icon: "input-mouse",
0039             title: i18nc("System mouse navigation", "Mouse Navigation"),
0040             defaultnessKey: "mouseIsDefaults"
0041         },
0042         {
0043             icon: "audio-input-microphone",
0044             title: i18nc("System mouse navigation", "Screen Reader"),
0045             defaultnessKey: "screenReaderIsDefaults"
0046         }
0047     ]
0048 
0049     RowLayout {
0050         id: mainLayout
0051         anchors.margins: Kirigami.Units.largeSpacing
0052         QQC2.ScrollView {
0053             id: leftSidePaneBackground
0054             contentHeight: root.contentItem.height -  Kirigami.Units.gridUnit * 4
0055             contentWidth: Kirigami.Units.gridUnit * 13
0056 
0057             Component.onCompleted: leftSidePaneBackground.background.visible = true
0058 
0059             ListView {
0060                 id: listView
0061                 activeFocusOnTab: true
0062                 clip: true
0063                 keyNavigationEnabled: true
0064                 model: elements
0065 
0066                 onCurrentIndexChanged: stackView.currentIndex = currentIndex
0067 
0068                 delegate: QQC2.ItemDelegate {
0069                     id: baseDelegate
0070 
0071                     width: listView.width
0072 
0073                     icon.name: modelData.icon
0074                     text: modelData.title
0075 
0076                     onClicked: {
0077                         listView.currentIndex = index
0078                         listView.forceActiveFocus()
0079                     }
0080 
0081                     contentItem: RowLayout {
0082                         spacing: Kirigami.Units.smallSpacing
0083 
0084                         KD.IconTitleSubtitle {
0085                             Layout.fillWidth: true
0086                             icon.name: baseDelegate.icon.name
0087                             title: baseDelegate.text
0088                         }
0089 
0090                         Rectangle {
0091                             radius: width * 0.5
0092                             implicitWidth: Kirigami.Units.largeSpacing
0093                             implicitHeight: Kirigami.Units.largeSpacing
0094                             visible: kcm.defaultsIndicatorsVisible
0095                             opacity: !kcm[modelData.defaultnessKey]
0096                             color: Kirigami.Theme.neutralTextColor
0097                         }
0098                     }
0099                 }
0100             }
0101         }
0102 
0103         StackLayout {
0104             id: stackView
0105             Layout.fillWidth: true
0106             Layout.fillHeight: true
0107 
0108             Bell {
0109                 Layout.fillWidth: true
0110                 Layout.fillHeight: true
0111             }
0112             ModifierKeys {
0113                 Layout.fillWidth: true
0114                 Layout.fillHeight: true
0115 
0116             }
0117             KeyboardFilters {
0118                 Layout.fillWidth: true
0119                 Layout.fillHeight: true
0120 
0121             }
0122             MouseNavigation {
0123                 Layout.fillWidth: true
0124                 Layout.fillHeight: true
0125 
0126             }
0127             ScreenReader {
0128                 Layout.fillWidth: true
0129                 Layout.fillHeight: true
0130             }
0131         }
0132     }
0133 }