Accessibility: auto-fallback button accessible names - #356
Open
hesam-oxe wants to merge 2 commits into
Open
Conversation
AbstractButton now exposes an accessible name from an explicit setAccessibleName() or, as a fallback, its tooltip, so icon-only buttons (close, mute, record, play) are named for screen readers without per-call-site fixes. FlatButton and SettingsButton also set the name from their text.
|
|
ilya-fedin
reviewed
Aug 29, 2026
Comment on lines
+227
to
+235
| const auto custom = QWidget::accessibleName(); | ||
| if (!custom.isEmpty()) { | ||
| return custom; | ||
| } | ||
| const auto tip = toolTip(); | ||
| if (!tip.isEmpty()) { | ||
| return tip; | ||
| } | ||
| return QString(); |
Contributor
There was a problem hiding this comment.
This is unnecessary complicated.
Suggested change
| const auto custom = QWidget::accessibleName(); | |
| if (!custom.isEmpty()) { | |
| return custom; | |
| } | |
| const auto tip = toolTip(); | |
| if (!tip.isEmpty()) { | |
| return tip; | |
| } | |
| return QString(); | |
| return toolTip(); |
ilya-fedin
reviewed
Aug 29, 2026
|
|
||
| void FlatButton::setText(const QString &text) { | ||
| _text = text; | ||
| setAccessibleName(text); |
Contributor
There was a problem hiding this comment.
FlatButton::accessibilityName already returns _text, this change has no sense
ilya-fedin
reviewed
Aug 29, 2026
|
|
||
| void SettingsButton::setText(TextWithEntities &&text) { | ||
| _text.setMarkedText(_st.style, text, kMarkupTextOptions, _context); | ||
| setAccessibleName(_text.toString()); |
Contributor
There was a problem hiding this comment.
SettingsButton::accessibilityName already returns _text.toString(), this change has no sense
Make Ui::Accessible::SubItem implement QAccessibleActionInterface so individual message cells (reply quotes and inline media) can be invoked by screen readers, not just whole rows. Adds RpWidget::accessibilityChildSubItemSupportsActions()/Activate() virtuals that owners override to wire the action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ui::AbstractButtonnow exposes an accessible name automatically for screen readers (NVDA/JAWS/ORCA):setAccessibleName()was set, it is used as before.toolTip()is used as a fallback.FlatButtonandSettingsButtonalso callsetAccessibleName()from their text.This means icon-only buttons (close, mute, record, play, etc.) that previously had no accessible name now announce their tooltip, addressing the missing-name reports in telegramdesktop/tdesktop#476. It is the foundational, low-risk part of a larger accessibility effort; focus-navigation, context-menu focus announcements, inline-media
InvokePattern, and voice-recording keyboard alternatives remain follow-up work.Changes
ui/abstract_button.cpp/ui/abstract_button.h: addedAbstractButton::accessibilityName()override with the explicit-name -> tooltip fallback.ui/widgets/buttons.cpp:FlatButton::setTextandSettingsButton::setTextset the accessible name from their text.Related
feat/accessibility-base-refactor).