Add: ctrl as well as shift selection using a text cursor#6167
Merged
vadi2 merged 207 commits intoMudlet:developmentfrom Jul 28, 2022
Merged
Add: ctrl as well as shift selection using a text cursor#6167vadi2 merged 207 commits intoMudlet:developmentfrom
vadi2 merged 207 commits intoMudlet:developmentfrom
Conversation
First, rename mLastRenderBottom to mLastRenderedOffset. The old name is misleading because it actually holds the line that was at the top of the screen when it was last rendered, not the bottom. Also add explanation of what mScrollVector means. These changes help understand the logic at TTextEdit::drawForeground().
TConsole is best viewer as a container of other widgets, rather than a widget itself. Therefore, it makes more sense to add accessibility support to its inner widgets.
…ibleTextEdit Thanks to Stephen Lyons for the suggestion.
Use plain strings rather than QStringLiterals. The QStringLiteral() versions add annoying double quotes to the output. Also, use function calls rather than streams to output the messages. The syntax is more compact and allows for better control of the formatting.
… interface_cast() QAccessibleWidget's version already does that for us. Also take the opportunity to remove some unnecessary headers.
Rely on the superclass' implementation.
It's redundant, because QAccessibleWidget's constructor already takes a role argument.
This communicates that they're internal helpers for the class implementation and aren't used anywhere else.
…contents ... as oposed to assuming that every (x, y) coordinate contains a character.
The current cursor position isn't relevant in the calculation.
This fixes the following warning: 'TAccessibleTextEdit::text' hides overloaded virtual function Adjust lineForOffset() and cursorPosition() to take into account the newlines added by join(). Also, simplify text(int startOffset, int endOffset) using the new text(QAccessible::Text t) method.
… on the last char
Support only selection 0.
…and textAtOffset()
It's partially based on QAccessibleTextWidget::attributes() from Qt 5.15.
Also, remove ‘DocumentContentChanged’ event from TConsole::print() methods because both call TTextEdit::showNewLines(), which already sends ‘TextInsertEvent’.
This was referenced Jul 23, 2022
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.
Brief overview of PR changes/additions
Ctrl and/or shift selection using a text cursor.
Motivation for adding to Mudlet
So that visually impaired players can navigate, select, and copy text using common keyboard shortcuts they already know.
Other info (issues closed, discussion etc)
Builds upon #6090 and requires that to be merged first.
Peek.2022-07-23.06-07.mp4