mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
FIX(a11y): Explicitly set the accessible name of "Next" and "Back" buttons in wizards
For some or all screen readers the "Next >" and "Back <" buttons in wizards read out the ">" and "<" symbols which is rather annoying. This commit explicitly sets the accessible name attribute such that the buttons are read without the symbols.
This commit is contained in:
parent
caa1490102
commit
9d281c0e04
@ -5,6 +5,9 @@
|
||||
|
||||
#include "Accessibility.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QObject>
|
||||
|
||||
namespace Mumble {
|
||||
namespace Accessibility {
|
||||
|
||||
@ -12,5 +15,10 @@ namespace Accessibility {
|
||||
widget->setAccessibleDescription(label->text().remove(QRegExp("<[^>]*>")));
|
||||
}
|
||||
|
||||
void fixWizardButtonLabels(QWizard *wizard) {
|
||||
wizard->button(QWizard::NextButton)->setAccessibleName(QObject::tr("Next"));
|
||||
wizard->button(QWizard::BackButton)->setAccessibleName(QObject::tr("Back"));
|
||||
}
|
||||
|
||||
} // namespace Accessibility
|
||||
} // namespace Mumble
|
||||
|
||||
@ -8,11 +8,13 @@
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QWizard>
|
||||
|
||||
namespace Mumble {
|
||||
namespace Accessibility {
|
||||
|
||||
void setDescriptionFromLabel(QWidget *widget, const QLabel *label);
|
||||
void fixWizardButtonLabels(QWizard *wizard);
|
||||
|
||||
} // namespace Accessibility
|
||||
} // namespace Mumble
|
||||
|
||||
@ -38,6 +38,8 @@ AudioWizard::AudioWizard(QWidget *p) : QWizard(p) {
|
||||
qsMaxAmp->setAccessibleName(tr("Maximum amplification"));
|
||||
qsVAD->setAccessibleName(tr("VAD level"));
|
||||
|
||||
Mumble::Accessibility::fixWizardButtonLabels(this);
|
||||
|
||||
Mumble::Accessibility::setDescriptionFromLabel(qrbQualityLow, qlQualityLow);
|
||||
Mumble::Accessibility::setDescriptionFromLabel(qrbQualityBalanced, qlQualityBalanced);
|
||||
Mumble::Accessibility::setDescriptionFromLabel(qrbQualityUltra, qlQualityUltra);
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
#include "Cert.h"
|
||||
|
||||
#include "Accessibility.h"
|
||||
#include "SelfSignedCertificate.h"
|
||||
#include "Utils.h"
|
||||
#include "Global.h"
|
||||
@ -131,6 +132,8 @@ CertWizard::CertWizard(QWidget *p) : QWizard(p) {
|
||||
qleEmail->setAccessibleName(tr("Email address"));
|
||||
qleName->setAccessibleName(tr("Your name"));
|
||||
|
||||
Mumble::Accessibility::fixWizardButtonLabels(this);
|
||||
|
||||
setOption(QWizard::NoCancelButton, false);
|
||||
|
||||
qwpExport->setCommitPage(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user