799e00d252
Unfortunately, most issues are in Kirigami and we can't fix them from our side. Namely, these things remain unfixed: - `Kirigami.PlaceholderMessage` are not read by screen readers - When navigating with the keyboard, pressing tab selects elements from right to left, which is weird - When navigating with the keyboard, the selected element is not highlighted - `Kirigami.Action` that don't have a `text` property don't use the `Accessible.name` property when using a screen reader.
82 lines
2.7 KiB
QML
82 lines
2.7 KiB
QML
/*
|
|
* SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.kdeconnect
|
|
|
|
Kirigami.ScrollablePage {
|
|
id: root
|
|
title: i18n("Plugin Settings")
|
|
property string device
|
|
|
|
ListView {
|
|
anchors.fill: parent
|
|
|
|
model: PluginModel {
|
|
deviceId: device
|
|
}
|
|
|
|
delegate: Kirigami.SwipeListItem {
|
|
|
|
contentItem: RowLayout {
|
|
CheckBox {
|
|
id: serviceCheck
|
|
Layout.alignment: Qt.AlignVCenter
|
|
checked: model.isChecked
|
|
onToggled: model.isChecked = checked
|
|
Accessible.name: model.name
|
|
Accessible.description: model.description
|
|
}
|
|
|
|
ColumnLayout {
|
|
spacing: 0
|
|
Layout.fillWidth: true
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Label {
|
|
Layout.fillWidth: true
|
|
text: model.name
|
|
elide: Text.ElideRight
|
|
}
|
|
|
|
Label {
|
|
Layout.fillWidth: true
|
|
text: model.description
|
|
elide: Text.ElideRight
|
|
font: Kirigami.Theme.smallFont
|
|
opacity: 0.7
|
|
}
|
|
}
|
|
}
|
|
|
|
actions: [
|
|
Kirigami.Action {
|
|
icon.name: "settings-configure"
|
|
visible: configSource != ""
|
|
// FIXME: not accessible. screen readers won't read this and just say "push button".
|
|
// https://bugreports.qt.io/browse/QTBUG-123123
|
|
Accessible.name: i18nd("kdeconnect-app", "Configure plugin")
|
|
onTriggered: {
|
|
if (pageStack.lastItem.toString().startsWith("PluginInfoPage")) {
|
|
pageStack.lastItem.configFile = configSource;
|
|
pageStack.lastItem.title = name;
|
|
pageStack.goForward();
|
|
} else {
|
|
pageStack.push(Qt.resolvedUrl("PluginInfoPage.qml"), {
|
|
title: name,
|
|
configFile: configSource,
|
|
device: root.device,
|
|
});
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|