FIX(a11y): Improve accessibility of the edit shortcut dialog

This commit switches the label in the shortcut dialog from
"Add" to "Listening to input" when the button is pressed.
This is supposed to indicate to screen readers that
the dialog is now in a different state, which is actually
listening for new key presses.
This commit is contained in:
Hartmnt 2023-04-20 13:14:42 +00:00
parent 057932afd6
commit ca29279df9
2 changed files with 8 additions and 0 deletions

View File

@ -93,10 +93,12 @@ void GlobalShortcutButtons::toggleCapture(const bool enabled) {
GlobalShortcutEngine::engine->resetMap();
connect(GlobalShortcutEngine::engine, &GlobalShortcutEngine::buttonPressed, this,
&GlobalShortcutButtons::updateButtons);
m_ui->addButton->setText(QObject::tr("Listening for input"));
} else {
disconnect(GlobalShortcutEngine::engine, &GlobalShortcutEngine::buttonPressed, this,
&GlobalShortcutButtons::updateButtons);
removeEventFilter(this);
m_ui->addButton->setText(QObject::tr("Add"));
}
}

View File

@ -45,6 +45,9 @@
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Starts the capture process: all buttons you press will be added to the tree.&lt;/p&gt;&lt;p&gt;Once all buttons are released, the capture process stops automatically.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="accessibleDescription">
<string>Toggling this button will make the application listen for a shortcut. Once the shortcut is entered, the application stops listening for a shortcut. Multiple shortcuts can be assigned to the current action. Navigate to the shortcut list above to review the shortcuts currently assigned to the current action.</string>
</property>
<property name="text">
<string>Add</string>
</property>
@ -58,6 +61,9 @@
<property name="toolTip">
<string>Remove the currently selected items</string>
</property>
<property name="accessibleDescription">
<string>This button will remove the selected shortcut for the current action. Note that you will have to select a shortcut from the list above first before this button has any effect.</string>
</property>
<property name="text">
<string>Remove</string>
</property>