Commit 5b9813fa authored by Benjamin Port's avatar Benjamin Port Committed by Benjamin Port

[KCM] Enable default highlighting for Accessibility

- Port to SettingStateBinding
- Port to KCModuleData
parent 60767536
......@@ -12,6 +12,14 @@ kconfig_add_kcfg_files(kcm_access_PART_SRCS
kcmaccessibilityscreenreader.kcfgc
GENERATE_MOC)
kcmutils_generate_module_data(
kcm_access_PART_SRCS
MODULE_DATA_HEADER kcmaccessibilitydata.h
MODULE_DATA_CLASS_NAME AccessibilityData
SETTINGS_HEADERS kcmaccessibilitybell.h kcmaccessibilitykeyboard.h kcmaccessibilitymouse.h kcmaccessibilityscreenreader.h
SETTINGS_CLASSES BellSettings KeyboardSettings MouseSettings ScreenReaderSettings
)
add_library(kcm_access MODULE ${kcm_access_PART_SRCS})
target_link_libraries(kcm_access
......
......@@ -51,8 +51,9 @@
#include "kcmaccessibilitykeyboard.h"
#include "kcmaccessibilitymouse.h"
#include "kcmaccessibilityscreenreader.h"
#include "kcmaccessibilitydata.h"
K_PLUGIN_FACTORY_WITH_JSON(KCMAccessFactory, "kcm_access.json", registerPlugin<KAccessConfig>();)
K_PLUGIN_FACTORY_WITH_JSON(KCMAccessFactory, "kcm_access.json", registerPlugin<KAccessConfig>(); registerPlugin<AccessibilityData>();)
QString mouseKeysShortcut(Display *display)
{
......@@ -152,10 +153,7 @@ QString mouseKeysShortcut(Display *display)
KAccessConfig::KAccessConfig(QObject *parent, const QVariantList& args)
: KQuickAddons::ManagedConfigModule(parent, args)
, m_mouseSettings(new MouseSettings(this))
, m_bellSettings(new BellSettings(this))
, m_keyboardSettings(new KeyboardSettings(this))
, m_screenReaderSettings(new ScreenReaderSettings(this))
, m_data(new AccessibilityData(this))
, m_desktopShortcutInfo(QX11Info::isPlatformX11() ? mouseKeysShortcut(QX11Info::display()) : QString())
{
qmlRegisterType<MouseSettings>();
......@@ -217,7 +215,7 @@ void KAccessConfig::save()
{
ManagedConfigModule::save();
if (m_bellSettings->systemBell() || m_bellSettings->customBell() || m_bellSettings->visibleBell()) {
if (bellSettings()->systemBell() || bellSettings()->customBell() || bellSettings()->visibleBell()) {
KConfig _cfg(QStringLiteral("kdeglobals"), KConfig::NoGlobals);
KConfigGroup cfg(&_cfg, "General");
cfg.writeEntry("UseSystemBell", true);
......@@ -250,4 +248,24 @@ bool KAccessConfig::orcaInstalled()
return tryOrcaRun != -2;
}
MouseSettings *KAccessConfig::mouseSettings() const
{
return m_data->mouseSettings();
}
BellSettings *KAccessConfig::bellSettings() const
{
return m_data->bellSettings();
}
KeyboardSettings *KAccessConfig::keyboardSettings() const
{
return m_data->keyboardSettings();
}
ScreenReaderSettings *KAccessConfig::screenReaderSettings() const
{
return m_data->screenReaderSettings();
}
#include "kcmaccess.moc"
......@@ -30,14 +30,15 @@ class MouseSettings;
class BellSettings;
class KeyboardSettings;
class ScreenReaderSettings;
class AccessibilityData;
class KAccessConfig : public KQuickAddons::ManagedConfigModule
{
Q_OBJECT
Q_PROPERTY(MouseSettings *mouseSettings MEMBER m_mouseSettings CONSTANT)
Q_PROPERTY(BellSettings *bellSettings MEMBER m_bellSettings CONSTANT)
Q_PROPERTY(KeyboardSettings *keyboardSettings MEMBER m_keyboardSettings CONSTANT)
Q_PROPERTY(ScreenReaderSettings *screenReaderSettings MEMBER m_screenReaderSettings CONSTANT)
Q_PROPERTY(MouseSettings *mouseSettings READ mouseSettings CONSTANT)
Q_PROPERTY(BellSettings *bellSettings READ bellSettings CONSTANT)
Q_PROPERTY(KeyboardSettings *keyboardSettings READ keyboardSettings CONSTANT)
Q_PROPERTY(ScreenReaderSettings *screenReaderSettings READ screenReaderSettings CONSTANT)
Q_PROPERTY(QString orcaLaunchFeedback READ orcaLaunchFeedback WRITE setOrcaLaunchFeedback NOTIFY orcaLaunchFeedbackChanged)
Q_PROPERTY(QString desktopShortcutInfo MEMBER m_desktopShortcutInfo CONSTANT)
Q_PROPERTY(bool screenReaderInstalled MEMBER m_screenReaderInstalled CONSTANT)
......@@ -55,16 +56,18 @@ public:
QString orcaLaunchFeedback() const;
MouseSettings *mouseSettings() const;
BellSettings *bellSettings() const;
KeyboardSettings *keyboardSettings() const;
ScreenReaderSettings *screenReaderSettings() const;
Q_SIGNALS:
void orcaLaunchFeedbackChanged();
private:
void setOrcaLaunchFeedback(const QString& value);
MouseSettings *m_mouseSettings;
BellSettings *m_bellSettings;
KeyboardSettings *m_keyboardSettings;
ScreenReaderSettings *m_screenReaderSettings;
AccessibilityData *m_data;
QString m_orcaLaunchFeedback;
QString m_desktopShortcutInfo;
bool m_screenReaderInstalled;
......
......@@ -23,7 +23,7 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.12 as QQC2
import QtQuick.Dialogs 1.3 as Dialogs
import org.kde.kcm 1.1 as KCM
import org.kde.kcm 1.3 as KCM
import org.kde.kquickcontrols 2.0 as KQuickAddons
import org.kde.kirigami 2.3 as Kirigami
......@@ -44,8 +44,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Audible bell:")
text: i18nc("Enable the system bell", "Enable")
enabled: !kcm.bellSettings.isImmutable("SystemBell")
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "SystemBell"
}
checked: kcm.bellSettings.systemBell
onToggled: kcm.bellSettings.systemBell = checked
......@@ -53,7 +55,11 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Ring when toggling accessibility features with gestures")
enabled: !kcm.keyboardSettings.isImmutable("Gestures") && systemBell.checked
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "Gestures"
extraEnabledConditions: systemBell.checked
}
checked: kcm.keyboardSettings.gestures
onToggled: kcm.keyboardSettings.gestures = checked
......@@ -67,7 +73,11 @@ Kirigami.FormLayout {
id: customBell
Layout.alignment: Qt.AlignVCenter
enabled: !kcm.bellSettings.isImmutable("CustomBell") && kcm.bellSettings.systemBell
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "CustomBell"
extraEnabledConditions: kcm.bellSettings.systemBell
}
checked: kcm.bellSettings.customBell
onToggled: kcm.bellSettings.customBell= checked
......@@ -78,7 +88,11 @@ Kirigami.FormLayout {
text: kcm.bellSettings.customBellFile
enabled: !kcm.bellSettings.isImmutable("CustomBellFile") && kcm.bellSettings.customBell
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "CustomBellFile"
extraEnabledConditions: kcm.bellSettings.customBell
}
onEditingFinished: kcm.bellSettings.customBellFile = textEdit.text
}
......@@ -87,7 +101,11 @@ Kirigami.FormLayout {
QQC2.ToolTip.visible: down
QQC2.ToolTip.text: i18n("Search audio file for the system bell")
Accessible.name: i18n("Button search audio file")
enabled: !kcm.bellSettings.isImmutable("CustomBellFile") && kcm.bellSettings.customBell
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "CustomBellFile"
extraEnabledConditions: kcm.bellSettings.customBell
}
onClicked: fileDialog.open()
}
......@@ -101,7 +119,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Visual bell:")
text: i18nc("Enable visual bell", "Enable")
enabled: !kcm.bellSettings.isImmutable("VisibleBell")
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "VisibleBell"
}
checked: kcm.bellSettings.visibleBell
onToggled: kcm.bellSettings.visibleBell = checked
......@@ -112,7 +133,11 @@ Kirigami.FormLayout {
text: i18nc("Invert screen on a system bell", "Invert Screen")
enabled: !kcm.bellSettings.isImmutable("InvertScreen") && kcm.bellSettings.visibleBell
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "InvertScreen"
extraEnabledConditions: kcm.bellSettings.visibleBell
}
checked: kcm.bellSettings.invertScreen
onToggled: kcm.bellSettings.invertScreen = checked
......@@ -125,15 +150,20 @@ Kirigami.FormLayout {
text: i18nc("Flash screen on a system bell", "Flash")
enabled: !kcm.bellSettings.isImmutable("InvertScreen")
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "InvertScreen"
}
checked: !kcm.bellSettings.invertScreen
onToggled: kcm.bellSettings.invertScreen = !checked
}
KQuickAddons.ColorButton {
text: i18nc("Color of the system bell","Color")
enabled: !kcm.bellSettings.isImmutable("VisibleBellColor")
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "VisibleBellColor"
}
color: kcm.bellSettings.visibleBellColor
onAccepted: kcm.bellSettings.visibleBellColor = color
......@@ -142,7 +172,11 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18nc("Duration of the system bell", "Duration:")
enabled: !kcm.bellSettings.isImmutable("VisibleBellPause") && kcm.bellSettings.visibleBell
KCM.SettingStateBinding {
configObject: kcm.bellSettings
settingName: "VisibleBellPause"
extraEnabledConditions: kcm.bellSettings.visibleBell
}
value: kcm.bellSettings.visibleBellPause
onValueModified: kcm.bellSettings.visibleBellPause = value
......
......@@ -21,7 +21,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.12 as QQC2
import org.kde.kcm 1.1 as KCM
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.3 as Kirigami
......@@ -32,7 +32,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Slow keys:")
text: i18nc("Enable slow keys", "Enable")
enabled: !kcm.keyboardSettings.isImmutable("SlowKeys")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeys"
}
checked: kcm.keyboardSettings.slowKeys
onToggled: kcm.keyboardSettings.slowKeys = checked
......@@ -43,7 +46,11 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18nc("Slow keys Delay", "Delay:")
enabled: !kcm.keyboardSettings.isImmutable("SlowKeysDelay") && kcm.keyboardSettings.slowKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeysDelay"
extraEnabledConditions: kcm.keyboardSettings.slowKeys
}
onValueChanged: kcm.keyboardSettings.slowKeysDelay = value
}
......@@ -56,7 +63,11 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Ring system bell:")
text: i18nc("Use system bell when a key is pressed", "&when any key is pressed")
enabled: !kcm.keyboardSettings.isImmutable("SlowKeysPressBeep") && kcm.keyboardSettings.slowKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeysPressBeep"
extraEnabledConditions: kcm.keyboardSettings.slowKeys
}
checked: kcm.keyboardSettings.slowKeysPressBeep
onToggled: kcm.keyboardSettings.slowKeysPressBeep = checked
......@@ -66,7 +77,11 @@ Kirigami.FormLayout {
text: i18nc("Use system bell when a key is accepted", "&when any key is accepted")
enabled: !kcm.keyboardSettings.isImmutable("SlowKeysAcceptBeep") && kcm.keyboardSettings.slowKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeysAcceptBeep"
extraEnabledConditions: kcm.keyboardSettings.slowKeys
}
checked: kcm.keyboardSettings.slowKeysAcceptBeep
onToggled: kcm.keyboardSettings.slowKeysAcceptBeep = checked
......@@ -76,7 +91,11 @@ Kirigami.FormLayout {
text: i18nc("Use system bell when a key is rejected", "&when any key is rejected")
enabled: !kcm.keyboardSettings.isImmutable("SlowKeysRejectBeep") && kcm.keyboardSettings.slowKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeysRejectBeep"
extraEnabledConditions: kcm.keyboardSettings.slowKeys
}
checked: kcm.keyboardSettings.slowKeysRejectBeep
onToggled: kcm.keyboardSettings.slowKeysRejectBeep = checked
......@@ -90,7 +109,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Bounce keys:")
text: i18nc("Bounce keys enable", "Enable");
enabled: !kcm.keyboardSettings.isImmutable("BounceKeys")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "BounceKeys"
}
checked: kcm.keyboardSettings.bounceKeys
onToggled: kcm.keyboardSettings.bounceKeys = checked
......@@ -101,9 +123,13 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18nc("Bounce keys delay", "Delay:")
enabled: !kcm.keyboardSettings.isImmutable("BounceKeysDelay") && kcm.keyboardSettings.bounceKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "BounceKeysDelay"
extraEnabledConditions: kcm.keyboardSettings.bounceKeys
}
onValueChanged: kcm.keyboardSettings.bounceDelay = value
onValueChanged: kcm.keyboardSettings.bounceKeysDelay = value
}
QQC2.CheckBox {
......@@ -111,7 +137,11 @@ Kirigami.FormLayout {
text: i18n("Ring system bell when rejected")
enabled: !kcm.keyboardSettings.isImmutable("BounceKeysRejectBeep") && kcm.keyboardSettings.bounceKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "BounceKeysRejectBeep"
extraEnabledConditions: kcm.keyboardSettings.bounceKeys
}
checked: kcm.keyboardSettings.bounceKeysRejectBeep
onToggled: kcm.keyboardSettings.bounceKeysRejectBeep = checked
......
......@@ -21,7 +21,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.12 as QQC2
import org.kde.kcm 1.1 as KCM
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.3 as Kirigami
......@@ -30,7 +30,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Sticky keys:")
text: i18nc("Enable sticky keys", "Enable")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeys")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeys"
}
checked: kcm.keyboardSettings.stickyKeys
onToggled: kcm.keyboardSettings.stickyKeys = checked
......@@ -38,7 +41,11 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18nc("Lock sticky keys", "Lock")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeysLatch") && kcm.keyboardSettings.stickyKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeysLatch"
extraEnabledConditions: kcm.keyboardSettings.stickyKeys
}
checked: kcm.keyboardSettings.stickyKeysLatch
onToggled: kcm.keyboardSettings.stickyKeysLatch = checked
......@@ -48,7 +55,11 @@ Kirigami.FormLayout {
text: i18n("Disable when two keys are held down")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeysAutoOff") && kcm.keyboardSettings.stickyKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeysAutoOff"
extraEnabledConditions: kcm.keyboardSettings.stickyKeys
}
checked: kcm.keyboardSettings.stickyKeysAutoOff
onToggled: kcm.keyboardSettings.stickyKeysAutoOff = checked
......@@ -56,7 +67,11 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Ring system bell when modifier keys are used")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeysBeep") && kcm.keyboardSettings.stickyKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeysBeep"
extraEnabledConditions: kcm.keyboardSettings.stickyKeys
}
checked: kcm.keyboardSettings.stickyKeysBeep
onToggled: kcm.keyboardSettings.stickyKeysBeep = checked
......@@ -70,7 +85,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Activation:")
text: i18n("Use gestures to activate")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeys")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeys"
}
checked: kcm.keyboardSettings.stickyKeys
onToggled: kcm.keyboardSettings.stickyKeys = checked
......@@ -80,14 +98,22 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Disable After:")
enabled: !kcm.keyboardSettings.isImmutable("StickyKeysAutoOff") && kcm.keyboardSettings.stickyKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "StickyKeysAutoOff"
extraEnabledConditions: kcm.keyboardSettings.stickyKeys
}
checked: kcm.keyboardSettings.stickyKeysAutoOff
onToggled: kcm.keyboardSettings.stickyKeysAutoOff = checked
}
QQC2.SpinBox {
enabled: !kcm.keyboardSettings.isImmutable("SlowKeysDelay") && kcm.keyboardSettings.stickyKeys
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "SlowKeysDelay"
extraEnabledConditions: kcm.keyboardSettings.stickyKeys
}
value: kcm.keyboardSettings.slowKeysDelay
onValueChanged: kcm.keyboardSettings.slowKeysDelay = value
......@@ -97,7 +123,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Feedback:")
text: i18n("Ring system bell when locking keys are toggled")
enabled: !kcm.keyboardSettings.isImmutable("ToggleKeysBeep")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "ToggleKeysBeep"
}
checked: kcm.keyboardSettings.toggleKeysBeep
onToggled: kcm.keyboardSettings.toggleKeysBeep = checked
......@@ -105,7 +134,10 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Show notification when modifier or locking keys are used")
enabled: !kcm.keyboardSettings.isImmutable("KeyboardNotifyModifiers")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "KeyboardNotifyModifiers"
}
checked: kcm.keyboardSettings.keyboardNotifyModifiers
onToggled: kcm.keyboardSettings.keyboardNotifyModifiers = checked
......
......@@ -21,7 +21,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12 as QQC2
import org.kde.kcm 1.1 as KCM
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.3 as Kirigami
Kirigami.FormLayout {
......@@ -31,7 +31,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("Use number pad to move cursor:")
text: i18n("Enable")
enabled: !kcm.mouseSettings.isImmutable("MouseKeys")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "MouseKeys"
}
checked: kcm.mouseSettings.mouseKeys
onToggled: kcm.mouseSettings.mouseKeys = checked
......@@ -40,7 +43,10 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("When a gesture is used:")
text: i18n("Display a confirmation dialog")
enabled: !kcm.keyboardSettings.isImmutable("GestureConfirmation")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "GestureConfirmation"
}
checked: kcm.keyboardSettings.gestureConfirmation
onToggled: kcm.keyboardSettings.gestureConfirmation = checked
......@@ -48,7 +54,10 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Ring the System Bell")
enabled: !kcm.keyboardSettings.isImmutable("Gestures")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "Gestures"
}
checked: kcm.keyboardSettings.gestures
onToggled: kcm.keyboardSettings.gestures = checked
......@@ -56,7 +65,10 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Show a notification")
enabled: !kcm.keyboardSettings.isImmutable("KeyboardNotifyAccess")
KCM.SettingStateBinding {
configObject: kcm.keyboardSettings
settingName: "KeyboardNotifyAccess"
}
checked: kcm.keyboardSettings.keyboardNotifyAccess
onToggled: kcm.keyboardSettings.keyboardNotifyAccess = checked
......@@ -69,7 +81,10 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18n("Acceleration delay:")
enabled: !kcm.mouseSettings.isImmutable("AccelerationDelay")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "AccelerationDelay"
}
value: kcm.mouseSettings.accelerationDelay
onValueChanged: kcm.mouseSettings.accelerationDelay = value
......@@ -77,7 +92,10 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18n("Repeat interval:")
enabled: !kcm.mouseSettings.isImmutable("RepetitionInterval")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "RepetitionInterval"
}
value: kcm.mouseSettings.repetitionInterval
onValueChanged: kcm.mouseSettings.repetitionInterval = value
......@@ -85,6 +103,10 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18n("Acceleration time:")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "AccelerationTime"
}
enabled: !kcm.mouseSettings.isImmutable("AccelerationTime")
value: kcm.mouseSettings.accelerationTime
......@@ -93,7 +115,10 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18n("Maximum speed:")
enabled: !kcm.mouseSettings.isImmutable("MaxSpeed")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "MaxSpeed"
}
value: kcm.mouseSettings.maxSpeed
onValueChanged: kcm.mouseSettings.maxSpeed = value
......@@ -101,7 +126,10 @@ Kirigami.FormLayout {
QQC2.SpinBox {
Kirigami.FormData.label: i18n("Acceleration profile:")
enabled: !kcm.mouseSettings.isImmutable("ProfileCurve")
KCM.SettingStateBinding {
configObject: kcm.mouseSettings
settingName: "ProfileCurve"
}
value: kcm.mouseSettings.profileCurve
onValueChanged: kcm.mouseSettings.profileCurve = value
......
......@@ -21,7 +21,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.12 as QQC2
import org.kde.kcm 1.1 as KCM
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.3 as Kirigami
Kirigami.FormLayout {
......@@ -30,7 +30,10 @@ Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Enable Screen Reader")
enabled: !kcm.screenReaderSettings.isImmutable("Enabled")
KCM.SettingStateBinding {
configObject: kcm.screenReaderSettings
settingName: "Enabled"
}
checked: kcm.screenReaderSettings.enabled
onToggled: kcm.screenReaderSettings.enabled = checked
......