Commit 874bdd0f authored by Benjamin Port's avatar Benjamin Port Committed by Benjamin Port

[KCM A11Y] Show for each list page if we have default value or not

parent e80ef5da
......@@ -174,6 +174,12 @@ KAccessConfig::KAccessConfig(QObject *parent, const QVariantList& args)
setButtons(ConfigModule::Apply | ConfigModule::Default | ConfigModule::Help);
setAboutData(about);
connect(m_data->bellSettings(), &BellSettings::configChanged, this, &KAccessConfig::bellIsDefaultsChanged);
connect(m_data->mouseSettings(), &MouseSettings::configChanged, this, &KAccessConfig::mouseIsDefaultsChanged);
connect(m_data->keyboardFiltersSettings(), &ScreenReaderSettings::configChanged, this, &KAccessConfig::keyboardFiltersIsDefaultsChanged);
connect(m_data->keyboardSettings(), &ScreenReaderSettings::configChanged, this, &KAccessConfig::keyboardModifiersIsDefaultsChanged);
connect(m_data->screenReaderSettings(), &ScreenReaderSettings::configChanged, this, &KAccessConfig::screenReaderIsDefaultsChanged);
}
KAccessConfig::~KAccessConfig()
......@@ -275,4 +281,29 @@ ScreenReaderSettings *KAccessConfig::screenReaderSettings() const
return m_data->screenReaderSettings();
}
bool KAccessConfig::bellIsDefaults() const
{
return bellSettings()->isDefaults();
}
bool KAccessConfig::mouseIsDefaults() const
{
return mouseSettings()->isDefaults();
}
bool KAccessConfig::keyboardFiltersIsDefaults() const
{
return keyboardFiltersSettings()->isDefaults();
}
bool KAccessConfig::keyboardModifiersIsDefaults() const
{
return keyboardSettings()->isDefaults();
}
bool KAccessConfig::screenReaderIsDefaults() const
{
return screenReaderSettings()->isDefaults();
}
#include "kcmaccess.moc"
......@@ -44,6 +44,11 @@ class KAccessConfig : public KQuickAddons::ManagedConfigModule
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)
Q_PROPERTY(bool bellIsDefaults READ bellIsDefaults NOTIFY bellIsDefaultsChanged)
Q_PROPERTY(bool mouseIsDefaults READ mouseIsDefaults NOTIFY mouseIsDefaultsChanged)
Q_PROPERTY(bool keyboardFiltersIsDefaults READ keyboardFiltersIsDefaults NOTIFY keyboardFiltersIsDefaultsChanged)
Q_PROPERTY(bool keyboardModifiersIsDefaults READ keyboardModifiersIsDefaults NOTIFY keyboardModifiersIsDefaultsChanged)
Q_PROPERTY(bool screenReaderIsDefaults READ screenReaderIsDefaults NOTIFY screenReaderIsDefaultsChanged)
public:
......@@ -64,8 +69,19 @@ public:
KeyboardFiltersSettings *keyboardFiltersSettings() const;
ScreenReaderSettings *screenReaderSettings() const;
bool bellIsDefaults() const;
bool mouseIsDefaults() const;
bool keyboardFiltersIsDefaults() const;
bool keyboardModifiersIsDefaults() const;
bool screenReaderIsDefaults() const;
Q_SIGNALS:
void orcaLaunchFeedbackChanged();
void bellIsDefaultsChanged();
void mouseIsDefaultsChanged();
void keyboardFiltersIsDefaultsChanged();
void keyboardModifiersIsDefaultsChanged();
void screenReaderIsDefaultsChanged();
private:
void setOrcaLaunchFeedback(const QString& value);
......
......@@ -37,23 +37,28 @@ KCM.SimpleKCM {
property var elements: [
{
icon: "notifications",
title: i18nc("System Bell", "Bell")
title: i18nc("System Bell", "Bell"),
defaultnessKey: "bellIsDefaults"
},
{
icon: "input-keyboard",
title: i18nc("System Modifier Keys", "Modifier Keys")
title: i18nc("System Modifier Keys", "Modifier Keys"),
defaultnessKey: "keyboardModifiersIsDefaults"
},
{
icon: "view-filter",
title: i18nc("System keyboard filters", "Keyboard Filters")
title: i18nc("System keyboard filters", "Keyboard Filters"),
defaultnessKey: "keyboardFiltersIsDefaults"
},
{
icon: "input-mouse",
title: i18nc("System mouse navigation", "Mouse Navigation")
title: i18nc("System mouse navigation", "Mouse Navigation"),
defaultnessKey: "mouseIsDefaults"
},
{
icon: "audio-input-microphone",
title: i18nc("System mouse navigation", "Screen Reader")
title: i18nc("System mouse navigation", "Screen Reader"),
defaultnessKey: "screenReaderIsDefaults"
}
]
......@@ -84,6 +89,15 @@ KCM.SimpleKCM {
icon: modelData.icon
label: modelData.title
onClicked: listView.forceActiveFocus()
Rectangle {
id: defaultIndicator
radius: width * 0.5
implicitWidth: Kirigami.Units.largeSpacing
implicitHeight: Kirigami.Units.largeSpacing
visible: kcm.defaultsIndicatorsVisible
opacity: !kcm[modelData.defaultnessKey]
color: Kirigami.Theme.neutralTextColor
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment