/*SPDX-FileCopyrightText: 2018 Tomaz Canabrava <tcanabrava@kde.org>SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL*/pragma ComponentBehavior: Boundimport QtQuickimport QtQuick.Layoutsimport QtQuick.Windowimport QtQuick.Controls as QQC2import org.kde.kirigami as Kirigamiimport org.kde.kirigami.delegates as KDimport org.kde.kcmutils as KCMUtilsimport org.kde.kwindowsystemKCMUtils.AbstractKCM {id: rootimplicitWidth: Kirigami.Units.gridUnit * 45implicitHeight: Kirigami.Units.gridUnit * 25framedView: falseproperty var elements: [{icon: "zoom-in",title: i18nc("@title Category name in sidebar", "Zoom & Magnifier"),defaultnessKey: "zoomMagnifierIsDefaults",componentUrl: Qt.resolvedUrl("ZoomMagnifier.qml")},{icon: "notifications",title: i18nc("@title Category name in sidebar", "System Bell"),defaultnessKey: "bellIsDefaults",componentUrl: Qt.resolvedUrl("Bell.qml")},{icon: "input-keyboard",title: i18nc("@title Category name in sidebar", "Modifier Keys"),defaultnessKey: "keyboardModifiersIsDefaults",componentUrl: Qt.resolvedUrl("ModifierKeys.qml")},{icon: "view-filter",title: i18nc("@title Category name in sidebar", "Keyboard Filters"),defaultnessKey: "keyboardFiltersIsDefaults",componentUrl: Qt.resolvedUrl("KeyboardFilters.qml")},{icon: "input-mouse",title: i18nc("@title Category name in sidebar", "Mouse Navigation"),defaultnessKey: "mouseIsDefaults",componentUrl: Qt.resolvedUrl("MouseNavigation.qml")},{icon: "input-mouse-click-left",title: i18nc("@title Category name in sidebar", "Dwell Clicker"),defaultnessKey: "dwellClickerIsDefaults",componentUrl: Qt.resolvedUrl("DwellClicker.qml")},{icon: "text-speak",title: i18nc("@title Category name in sidebar", "Screen Reader"),defaultnessKey: "screenReaderIsDefaults",componentUrl: Qt.resolvedUrl("ScreenReader.qml")},{icon: "view-visible",title: i18nc("@title Category name in sidebar", "Color Blindness Correction"),defaultnessKey: "colorblindnessCorrectionIsDefaults",componentUrl: Qt.resolvedUrl("ColorblindnessCorrection.qml")},{icon: "image-invert-symbolic",title: i18nc("@title Category name in sidebar, for inverting screen colors", "Invert"),defaultnessKey: "invertIsDefaults",componentUrl: Qt.resolvedUrl("Invert.qml")},{icon: "cursor-arrow",title: i18nc("@title Category name in sidebar, shake pointer to find it", "Shake Pointer"),defaultnessKey: "shakeCursorIsDefaults",available: KWindowSystem.isPlatformWayland,componentUrl: Qt.resolvedUrl("ShakeCursor.qml")}]RowLayout {id: mainLayoutanchors.fill: parentspacing: 0QQC2.ScrollView {id: leftSidePaneBackgroundLayout.fillHeight: trueLayout.minimumWidth: Kirigami.Units.gridUnit * 13Kirigami.Theme.colorSet: Kirigami.Theme.ViewKirigami.Theme.inherit: falseListView {id: listViewactiveFocusOnTab: trueclip: truekeyNavigationEnabled: truemodel: root.elementsdelegate: QQC2.ItemDelegate {id: baseDelegaterequired property int indexrequired property var modelDatawidth: listView.widthhighlighted: listView.currentIndex === indexicon.name: modelData.icontext: modelData.titlevisible: modelData.available === undefined || modelData.availableonClicked: {listView.currentIndex = indexlistView.forceActiveFocus()}contentItem: RowLayout {spacing: Kirigami.Units.smallSpacingKD.IconTitleSubtitle {Layout.fillWidth: trueicon.name: baseDelegate.icon.nametitle: baseDelegate.textselected: baseDelegate.highlighted || baseDelegate.down}Rectangle {radius: width * 0.5implicitWidth: Kirigami.Units.largeSpacingimplicitHeight: Kirigami.Units.largeSpacingvisible: kcm.defaultsIndicatorsVisibleopacity: !kcm[modelData.defaultnessKey]color: Kirigami.Theme.neutralTextColor}}}}}Kirigami.Separator {Layout.fillHeight: true}Rectangle {Layout.fillWidth: trueLayout.fillHeight: trueKirigami.Theme.colorSet: Kirigami.Theme.WindowKirigami.Theme.inherit: falsecolor: Kirigami.Theme.backgroundColorQQC2.ScrollView {id: scrollViewanchors.fill: parentcontentWidth: availableWidthcontentHeight: pageLoader.implicitHeight > 0 ? undefined : availableHeightKirigami.Padding {anchors.fill: parentpadding: Kirigami.Units.gridUnitcontentItem: Loader {id: pageLoadersource: listView.currentItem?.modelData?.componentUrl ?? ""}}}}}}