Skip to content

Commit

Permalink
Add accessible texts to UI elements (open-eid#1086)
Browse files Browse the repository at this point in the history
IB-7305

Signed-off-by: Raul Metsma <[email protected]>

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Sep 21, 2022
1 parent 7c16ebd commit 9bedece
Show file tree
Hide file tree
Showing 9 changed files with 636 additions and 667 deletions.
8 changes: 8 additions & 0 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class MacMenuBar {};
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QSslCertificate>
#include <QtNetwork/QSslConfiguration>
#include <QtWidgets/QAccessibleWidget>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QProgressDialog>
Expand Down Expand Up @@ -337,6 +338,13 @@ Application::Application( int &argc, char **argv )

QDesktopServices::setUrlHandler(QStringLiteral("browse"), this, "browse");
QDesktopServices::setUrlHandler(QStringLiteral("mailto"), this, "mailTo");
QAccessible::installFactory([](const QString &classname, QObject *object) {
QAccessibleInterface *interface = nullptr;
if (classname == QLatin1String("QSvgWidget") && object && object->isWidgetType())
interface = new QAccessibleWidget(static_cast<QWidget *>(object), QAccessible::StaticText);
return interface;
});


installTranslator( &d->appTranslator );
installTranslator( &d->commonTranslator );
Expand Down
7 changes: 1 addition & 6 deletions client/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,7 @@ MainWindow::MainWindow( QWidget *parent )
ui->version->setText(QStringLiteral("%1%2").arg(tr("Ver. "), qApp->applicationVersion()));
connect(ui->version, &QPushButton::clicked, this, [this] {showSettings(SettingsDialog::DiagnosticsSettings);});

QSvgWidget* coatOfArms = new QSvgWidget(ui->logo);
coatOfArms->setStyleSheet(QStringLiteral("border: none;"));
coatOfArms->load(QStringLiteral(":/images/Logo_small.svg"));
coatOfArms->resize( 80, 32 );
coatOfArms->move( 15, 17 );

ui->coatOfArms->load(QStringLiteral(":/images/Logo_small.svg"));
ui->signature->init( Pages::SignIntro, ui->signatureShadow, true );
ui->crypto->init( Pages::CryptoIntro, ui->cryptoShadow, false );
ui->myEid->init( Pages::MyEid, ui->myEidShadow, false );
Expand Down
Loading

0 comments on commit 9bedece

Please sign in to comment.