Skip to content

Commit

Permalink
FIX(a11y): Make search result tree accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Jan 6, 2024
1 parent fdb4a26 commit a3e0144
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/mumble/SearchDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#include "Accessibility.h"
#include "SearchDialog.h"
#include "Channel.h"
#include "ClientUser.h"
Expand All @@ -26,6 +27,8 @@

#include <stack>

#include <QDebug>

namespace Search {

QString SearchDialog::toString(UserAction action) {
Expand Down Expand Up @@ -226,13 +229,41 @@ void SearchDialog::on_searchResultTree_currentItemChanged(QTreeWidgetItem *c, QT
if (user) {
// Only try to select the user if (s)he still exists
Global::get().mw->pmModel->setSelectedUser(user->uiSession);
item.setData(0, Qt::AccessibleTextRole, Mumble::Accessibility::userToText(user));
item.setData(1, Qt::AccessibleTextRole, Mumble::Accessibility::userToText(user));
item.setData(0, Qt::AccessibleDescriptionRole, Mumble::Accessibility::userToText(user));
item.setData(1, Qt::AccessibleDescriptionRole, Mumble::Accessibility::userToText(user));
item.setToolTip(0, Mumble::Accessibility::userToText(user));
item.setToolTip(1, Mumble::Accessibility::userToText(user));
qDebug() << Mumble::Accessibility::userToText(user);
qDebug() << allColumnsShowFocus();
qDebug() << focusPolicy();
qDebug() << hasFocus();
qDebug() << selectionBehavior();
qDebug() << selectionMode();
qDebug() << tabKeyNavigation();
// updateMicroFocus
}
} else {
const Channel *channel = Channel::get(static_cast< int >(item.getID()));

if (channel) {
// Only try to select the channel if it still exists
Global::get().mw->pmModel->setSelectedChannel(channel->iId);
item.setData(0, Qt::AccessibleTextRole, Mumble::Accessibility::channelToText(channel));
item.setData(1, Qt::AccessibleTextRole, Mumble::Accessibility::channelToText(channel));
item.setData(0, Qt::AccessibleDescriptionRole, Mumble::Accessibility::channelToText(channel));
item.setData(1, Qt::AccessibleDescriptionRole, Mumble::Accessibility::channelToText(channel));
item.setToolTip(0, Mumble::Accessibility::channelToText(channel));
item.setToolTip(1, Mumble::Accessibility::channelToText(channel));
qDebug() << Mumble::Accessibility::channelToText(channel);
qDebug() << allColumnsShowFocus();
qDebug() << focusPolicy();
qDebug() << hasFocus();
qDebug() << selectionBehavior();
qDebug() << selectionMode();
qDebug() << tabKeyNavigation();
// updateMicroFocus
}
}
}
Expand Down

0 comments on commit a3e0144

Please sign in to comment.