-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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 hover state to Tree items display #88530
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,6 +509,12 @@ | |
<theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> | ||
Text [Color] for a [constant TreeItem.CELL_MODE_CHECK] mode cell when it's non-editable (see [method TreeItem.set_editable]). | ||
</theme_item> | ||
<theme_item name="font_hovered_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> | ||
Text [Color] used when the item is hovered. | ||
</theme_item> | ||
<theme_item name="font_hovered_dimmed_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> | ||
Text [Color] used when the item is hovered, while a button of the same item is hovered as the same time. | ||
</theme_item> | ||
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> | ||
The tint of text outline of the item. | ||
</theme_item> | ||
|
@@ -645,6 +651,9 @@ | |
<theme_item name="updown" data_type="icon" type="Texture2D"> | ||
The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. | ||
</theme_item> | ||
<theme_item name="button_hover" data_type="style" type="StyleBox"> | ||
[StyleBox] used when a button in the tree is hovered. | ||
</theme_item> | ||
<theme_item name="button_pressed" data_type="style" type="StyleBox"> | ||
[StyleBox] used when a button in the tree is pressed. | ||
</theme_item> | ||
|
@@ -666,6 +675,12 @@ | |
<theme_item name="focus" data_type="style" type="StyleBox"> | ||
The focused style for the [Tree], drawn on top of everything. | ||
</theme_item> | ||
<theme_item name="hovered" data_type="style" type="StyleBox"> | ||
[StyleBox] for the item being hovered. | ||
</theme_item> | ||
<theme_item name="hovered_dimmed" data_type="style" type="StyleBox"> | ||
[StyleBox] for the item being hovered, while a button of the same item is hovered as the same time. | ||
</theme_item> | ||
Comment on lines
+681
to
+683
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
<theme_item name="panel" data_type="style" type="StyleBox"> | ||
The background style for the [Tree]. | ||
</theme_item> | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Unsure of what this is referring to, when looking at the video preview and description. Calling the property itself "dimmed" is not a good idea. The adjective refers to the custom color used, and as such it may not always be dimmed.
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.
When you hover the action icons, the row still has a hover highlight but different than when you hover the "main" part of the row, as I explained above.
Observe the animation closely and you will spot the difference, when the mouse moves between the main part of the row and the action icons on an unselected row. The row highlight is still here, with less contrast in both the selection box and the text color (hence the two properties you mention). Of course, the user is free to set anything for those and they can be rendered using a completely different color; not just a dimmed aspect.
This allows the icons hover to be visible even if the Tree is in full row highlight mode.
I had to choose a word. Would you have a different suggestion? Ideas: hovered_secondary
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.
The current color should've been called
font_hovered_highlight_color
and this one should befont_hovered_color
but that obviously cannot be done, unless we're doing some very messy compatibility work, hmm.... That's a pretty difficult question, actually.If I have a saying on this, I would call it based on the very thing it is used for, no vague adjectives:
font_hovered_on_button_color
. Something like this.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.
"Hovered on button" may lead to confusion, because there is no mechanism to customize the buttons hover color yet.
The naming question should be taken globally for the font (font_hovered_dimmed_color) and the background (hovered_dimmed) at the same time. If we attack problems one by one without seeing the bigger picture, we lose consistency.
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.
I think
dimmed
is fine here (muted
would work as a synonym, which is used in Material UI guidelines IIRC). It's hard to convey with a single word what it's exactly supposed to do.