Implement new displayChunk unit for display model#10165
Conversation
|
A couple of points:
I think I would like to see a new constant added. I feel that this usage of readingChunk is not really matching what readingChunk was originally for. I think calling it something like displayChunk is fine. I can't see how you could realy use it logically without knowing that you were dealing with displayModels anyway. |
Correct. I think cases where font weight, color or size differs for a single label are very limited. There is the multiple lines label though, indeed.
Thanks for pointing this out. So, I assume you're saying that if a piece of text is written in one large single chunk, and a part of that text is highlighted at some point, that that causes a split of the chunks, and that splitting continues if the highlight moves again, resulting in increasingly smaller chunks?
This makes much sense. IN fact, I had a previous implementation where I used a separate constnat. I will add such a constant again to the current pr. |
|
@michaelDCurran I updated the title and description of the pr accordingly. |
Also fix some indenting in changes for Developers section.
Link to issue number:
None
Summary of the issue:
In a display model, pieces of text are saved as separate chunks. This information is currently not available from NVDA APIs itself.
However, when trying to label text fields or combo boxes in an inaccessible application using a display model, this information is still pretty important, as a label is usually stored in one chunk.
Example
displayModel.DisplayModelTextInfo(fg, "all")getTextInChunksmethod on the textInfo, iterate through the text.this pcicon into two words, whereas using line offsets gives you an entire row of "desktop icons.Description of how this pull request fixes the issue:
I implemented support to get the distinc display model chunks from the display model. This is mapped to a new unit constant, displayModel.UNIT_DISPLAYCHUNK.
Testing performed:
Known issues with pull request:
Change log entry: