Skip to content

Conversation

rustbasic
Copy link
Contributor

should_show_hover_ui() only works on hover, so it's better to come out early.
Is there something different from what you intended or is there a problem?

@lucasmerlin
Copy link
Collaborator

lucasmerlin commented Sep 19, 2024

I think this is already handled in line 720:

        // Fast early-outs:
        if self.enabled {
            if !self.hovered || !self.ctx.input(|i| i.pointer.has_pointer()) {
                return false;
            }
        } else if !self.ctx.rect_contains_pointer(self.layer_id, self.rect) {
            return false;
        }

And I believe the reason the check is only done if self.enabled is that otherwise on_disabled_hover_ui wouldn't work, because things that aren't enabled don't get the hover event, but I'm not 100% sure.

You can try creating a disabled element with your changes and try if the on_disabled_hover_ui still works

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants