Skip to content
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

Dont Change Hovering during Control Focus Events #47280

Merged

Conversation

jasonwinterpixel
Copy link
Contributor

@jasonwinterpixel jasonwinterpixel commented Mar 23, 2021

I've talked with a few people on the chat about this. @Calinou and @vnen

This PR removes the alteration of hovering during Focus Enter and Focus Exit events. The alteration of hovering during Focus Enter and Exit events causes inconsistency in the UI. This PR makes the Hover and Focus styles more clear in their purpose and improves the consistency of the usage of those styles.

I've tested and am using this on our projects.

backport to 3.x: #47281

When a Node is focused, it renders with its Hover stylebox and its Focus stylebox. If the node is then then Hovered and UnHovered, the Hover stylebox is removed and replaced with a Normal stylebox. This is inconsistent. It is more logical and intuitive if Hover and Focus are treated as 2 independent mechanisms.

Before:
before_focushover

After:
after_focushover

Bugsquad edit: Fixes #29326.

…s Exit events. This is incorrect and not fully implemented, and results in inconsistency in the UI and in the hovering variable.
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the 3 states: hovered, not hovered, and focus (selection) better by making Hover and Focus as 2 independent mechanisms.

Edited:

Also there's a few other alternatives. https://zellwk.com/blog/style-hover-focus-active-states/

@KoBeWi
Copy link
Member

KoBeWi commented Jun 7, 2021

This probably resolves #29326

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I mentioned is a bit confusing so I wasn't able to confirm whether the PR fixes it xd

But the change looks ok.

@jasonwinterpixel
Copy link
Contributor Author

I think this resolves that other issue, as well. Nice find.

@akien-mga akien-mga merged commit 0cbb19a into godotengine:master Jun 9, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Aug 11, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is_hovered() is tied to button focus and not the actual cursor position
4 participants