-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add highlight to the relationship lines of selected Tree
items
#48546
Merged
akien-mga
merged 1 commit into
godotengine:master
from
YuriSizov:tree-highlight-selected-relationships
May 25, 2021
Merged
Add highlight to the relationship lines of selected Tree
items
#48546
akien-mga
merged 1 commit into
godotengine:master
from
YuriSizov:tree-highlight-selected-relationships
May 25, 2021
Conversation
This file contains 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
YuriSizov
force-pushed
the
tree-highlight-selected-relationships
branch
from
May 7, 2021 18:19
e307501
to
7194f8d
Compare
YuriSizov
force-pushed
the
tree-highlight-selected-relationships
branch
2 times, most recently
from
May 7, 2021 19:50
f3438e6
to
54e4bc9
Compare
KoBeWi
reviewed
May 25, 2021
KoBeWi
approved these changes
May 25, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok, but needs rebase after #46773
YuriSizov
force-pushed
the
tree-highlight-selected-relationships
branch
from
May 25, 2021 15:56
54e4bc9
to
9c92e9d
Compare
Rebased and corrected to use the new API. Seems to still be working as intended. |
Thanks! |
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.
Closes godotengine/godot-proposals#2654.
This adds several theme properties related to highlighting parents (up to the root) and direct children of the selected
Tree
item. In the editor these new options are used to improve visuals of our trees. In the default theme I've set it up so there is no immediate difference. Though this would still affect custom themes, as they need to override these new properties. Otherwise this could be cherrypicked.Following the arguments I've provided in the linked proposal, all parents but only direct children are selected. Parents also have a thicker line and more saturated color to it. Colors are controlled by their opacity based on the existing "relationship line opacity" setting, so at some point they all become completely opaque. I don't think that accent color can be used here as it ends up being too distracting.
Parent lines also have a small margin area around them pushing away non-highlighted relationship lines to improve the looks.
2021-05-07_21-01-42.mp4
This also fixes a little visual issue I've noticed with the relationship lines when the parent node doesn't have folding enabled. Lines tend to go off-screen in such scenarios if the root node is involved, or just look weirdly offset.
The problem is present in both the default theme and the editor theme. For this reason I've decided to address it directly in the control by adjusting the drawing logic. This should positively affect everyone's trees. Here's the default theme and the editor theme after the change.