FIX(a11y): Add "filtered" to accessibleName for TreeView, if applicable

Previously, there was no way to know for sure, if the currently selected
user and channel tree was being filtered. (in a screen reader context)

This commit switches the accessibleName depending on the channel filter
state.
This commit is contained in:
Hartmnt 2022-11-30 12:40:26 +00:00
parent 7a9452de67
commit be7c328eae

View File

@ -163,7 +163,6 @@ MainWindow::MainWindow(QWidget *p)
createActions();
setupUi(this);
setupGui();
qtvUsers->setAccessibleName(tr("Channels and users"));
qteLog->setAccessibleName(tr("Activity log"));
qteChat->setAccessibleName(tr("Chat message"));
connect(qmUser, SIGNAL(aboutToShow()), this, SLOT(qmUser_aboutToShow()));
@ -472,6 +471,7 @@ void MainWindow::setupGui() {
qaAudioTTS->setChecked(Global::get().s.bTTS);
#endif
qaFilterToggle->setChecked(Global::get().s.bFilterActive);
on_qaFilterToggle_triggered();
qaHelpWhatsThis->setShortcuts(QKeySequence::WhatsThis);
@ -2653,6 +2653,11 @@ void MainWindow::on_qaAudioReset_triggered() {
void MainWindow::on_qaFilterToggle_triggered() {
Global::get().s.bFilterActive = qaFilterToggle->isChecked();
if (!Global::get().s.bFilterActive) {
qtvUsers->setAccessibleName(tr("Channels and users"));
} else {
qtvUsers->setAccessibleName(tr("Filtered channels and users"));
}
updateUserModel();
}