Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add: ctrl as well as shift selection using a text cursor#6167

Merged
vadi2 merged 207 commits intoMudlet:developmentfrom
vadi2:text-shift-selection
Jul 28, 2022
Merged

Add: ctrl as well as shift selection using a text cursor#6167
vadi2 merged 207 commits intoMudlet:developmentfrom
vadi2:text-shift-selection

Conversation

@vadi2
Copy link
Member

@vadi2 vadi2 commented Jul 20, 2022

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

vadi2 and others added 30 commits February 21, 2022 22:36
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.
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’.
@vadi2 vadi2 marked this pull request as ready for review July 23, 2022 03:58
@vadi2 vadi2 requested a review from a team July 23, 2022 03:58
@vadi2 vadi2 requested a review from a team as a code owner July 23, 2022 03:58
@vadi2 vadi2 requested review from a team July 23, 2022 03:58
@vadi2 vadi2 changed the title Add: shift selection using a text cursor Add: ctrl as well as shift selection using a text cursor Jul 23, 2022
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Member

@demonnic demonnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vadi2 vadi2 enabled auto-merge (squash) July 28, 2022 05:08
@vadi2 vadi2 merged commit d65b097 into Mudlet:development Jul 28, 2022
@vadi2 vadi2 deleted the text-shift-selection branch July 28, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants