Repository navigation
feat(gpui): list the text painted in the inspector's last frame - #145
Merged
Merged
Conversation
Window::inspector_hitboxes says what is on screen and where, but not what it reads, so a tool driving the application cannot name a control by its words. Window::inspector_texts lists every painted run with its bounds and the ids of the elements around it. Filled under the same condition as the element map: debug_assertions and a picking inspector. A build without debug assertions has neither the field nor the calls.
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
Window::inspector_hitboxes(#142) tells a tool what is on screen and where, but not what it reads. This addsWindow::inspector_texts: every run of text painted in the last frame, with its bounds, content mask and the ids of the elements it was painted inside. A tool can then name a control by the words a person sees, in whichever language the window is drawn.No effect on normal builds
#[cfg(debug_assertions)], so a build without debug assertions compiles none of it.is_inspector_pickingcheck until the inspector is picking.Test plan
cargo fmt -p moon-gpui -- --checkcargo test -p moon-gpui, with a new test: nothing is listed outside picking, and a label's path and origin are those of its control