Skip to content

Commit

Permalink
FIX(a11y): Make global shortcut settings more accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Jan 7, 2024
1 parent 85f7370 commit 027aad9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/mumble/GlobalShortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,16 @@ GlobalShortcutConfig::GlobalShortcutConfig(Settings &st) : ConfigWidget(st) {
qtwShortcuts->setColumnCount(canSuppress ? 4 : 3);
qtwShortcuts->setItemDelegate(new ShortcutDelegate(qtwShortcuts));

qtwShortcuts->headerItem()->setData(0, Qt::AccessibleTextRole, tr("Shortcut action"));
qtwShortcuts->headerItem()->setData(1, Qt::AccessibleTextRole, tr("Shortcut data"));
qtwShortcuts->headerItem()->setData(2, Qt::AccessibleTextRole, tr("Shortcut input combinations"));

qtwShortcuts->header()->setSectionResizeMode(0, QHeaderView::Fixed);
qtwShortcuts->header()->resizeSection(0, 150);
qtwShortcuts->header()->setSectionResizeMode(2, QHeaderView::Stretch);
if (canSuppress)
if (canSuppress) {
qtwShortcuts->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
}

qcbEnableGlobalShortcuts->setVisible(canDisable);

Expand Down Expand Up @@ -705,6 +710,10 @@ void GlobalShortcutConfig::on_qtwShortcuts_itemChanged(QTreeWidgetItem *item, in
if (gs && sc.qvData.userType() != gs->qvDefault.userType()) {
item->setData(1, Qt::DisplayRole, gs->qvDefault);
}

item->setData(0, Qt::AccessibleTextRole, item->text(0));
item->setData(1, Qt::AccessibleTextRole, item->text(1));
item->setData(3, Qt::AccessibleDescriptionRole, item->checkState(3) == Qt::Checked ? tr("checked") : tr("unchecked"));
}

QString GlobalShortcutConfig::title() const {
Expand Down
12 changes: 11 additions & 1 deletion src/mumble/GlobalShortcut.ui
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,16 @@
</widget>
</item>
<item>
<widget class="QTreeWidget" name="qtwShortcuts">
<widget class="MultiColumnTreeWidget" name="qtwShortcuts">
<property name="toolTip">
<string>List of configured shortcuts</string>
</property>
<property name="accessibleName">
<string>Configured shortcuts</string>
</property>
<property name="accessibleDescription">
<string>Use up and down keys to navigate through your added shortcuts. Use left and right keys to navigate between actions and options for a single shortcut.</string>
</property>
<property name="editTriggers">
<set>QAbstractItemView::AllEditTriggers</set>
</property>
Expand Down Expand Up @@ -271,6 +274,13 @@ Without this option enabled, using Mumble's global shortcuts in privileged appli
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MultiColumnTreeWidget</class>
<extends>QTreeWidget</extends>
<header>widgets/MultiColumnTreeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit 027aad9

Please sign in to comment.