Visject: Improved comment renaming + visual fix #2652
Merged
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.
When renaming a comment in visject and the comment happens to not be fully visible in the visject window, the rename popup will be drawn outside the window.
This PR replaces the RenamePopup with a textbox inside the comment header itself. This is more in line with how other graph tools handle this case.
Fixes #2006
Additionally pressing ESC now will no longer apply the new name.
Note: I actually wanted the textbox text to align with the title. In the center. But this is currently buggy. See #2653. When the issue gets fixed i might change the alignment here as well.
Preview
Renaming before
![CommentRenamingBefore](https://private-user-images.githubusercontent.com/6757167/333796359-fa2c6602-388e-4724-a777-9c5db5a2a42d.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNTc4NjEsIm5iZiI6MTcxOTE1NzU2MSwicGF0aCI6Ii82NzU3MTY3LzMzMzc5NjM1OS1mYTJjNjYwMi0zODhlLTQ3MjQtYTc3Ny05YzVkYjVhMmE0MmQuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjNUMTU0NjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjM4MzI1MDhjOTExNmJiZDg3Y2Y5NTM5OWY0NTYyNWJkOGVhOTA0MjQ2ZThhZGE0MjgwNmM4YzlhOWQwMzAxMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.c_y32MMR5TSqzCXk_0hom_cqg4ui2ir78YxGPlvSoi8)
Renaming after
![CommentRenamingAfter](https://private-user-images.githubusercontent.com/6757167/333796367-4bc64d1d-522a-40be-84b6-22c404fe69c9.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNTc4NjEsIm5iZiI6MTcxOTE1NzU2MSwicGF0aCI6Ii82NzU3MTY3LzMzMzc5NjM2Ny00YmM2NGQxZC01MjJhLTQwYmUtODRiNi0yMmM0MDRmZTY5YzkuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjNUMTU0NjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODQ3ZGJlNDRjMTNjZTZjZjMwOGQ3YzljMDI3YTIxMTc3YTViODE3NzhlNjJjMTEzNzk3OWM0NjlkZTg0YTg3YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.kS2coaM-LRFBMxNvFxzIqqkWswU3ab47-a0b_WovHxQ)
Of course this means, that the textbox will now be cut off when renaming a comment that is outside the window. But i would argue that this is the expected behaviour. I also checked and other graph tools seem to just do the same.
![FlaxEditor_Hoi06StfMA](https://private-user-images.githubusercontent.com/6757167/333796216-dbf8b659-43d5-47e0-83e3-96ed90fb5136.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNTc4NjEsIm5iZiI6MTcxOTE1NzU2MSwicGF0aCI6Ii82NzU3MTY3LzMzMzc5NjIxNi1kYmY4YjY1OS00M2Q1LTQ3ZTAtODNlMy05NmVkOTBmYjUxMzYuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjNUMTU0NjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTQwZTA4MThlOTJjYWZhMzk4NTNiZTNhOWYxM2UxOTEwNzRhYmY3MTY3NzQ4NGVjYTZjZjcxNDcxOWM3Mzc5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.k_xbvxu1HWyvUDF1cq_5CmgAqTGsMQRWSsHd3KMNKcc)