Skip to content

Refactor control #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jperedadnr opened this issue Mar 17, 2022 · 0 comments · Fixed by #125
Closed

Refactor control #122

jperedadnr opened this issue Mar 17, 2022 · 0 comments · Fixed by #125
Assignees
Labels
breaking breaking changes ahead enhancement New feature or request
Milestone

Comments

@jperedadnr
Copy link
Collaborator

The main idea is to break the text that is coming from the PieceTable into paragraphs (mainly checking for \n ).

For each paragraph, we need a custom node that will have a TextFlow and a Selection. It can also have at the left a graphic/label (for indentation, bullet lists, line numbering…). So pretty much this would be like an
HBox with Label + Group(BackgroundPaths, Selection, TextFlow) .

This control per paragraph is then added to a simple VBox, but using a ListView will provide the VirtualFlow, with cellFactory -> the HBox node, and list items -> paragraphs.

Note that user’s selection will span multiple cells, and that’s why there is a Selection(path) inside each cell/HBox, instead of having one single big selection on top of the ListView.

So there is the extra work of handling mouse events from control to cells to textFlow to get hit positions.

@jperedadnr jperedadnr added enhancement New feature or request breaking breaking changes ahead labels Mar 17, 2022
@jperedadnr jperedadnr self-assigned this Mar 17, 2022
jperedadnr added a commit to jperedadnr/rich-text-area that referenced this issue Jul 11, 2023
Co-authored-by: jose.pereda <jose.pereda@gluonhq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking breaking changes ahead enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant