X Tutup
Skip to content

FoldableContainer: Override has_point to use title rect when folded#110847

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
StamLord:fix-foldablecontainer-pointer
Jan 1, 2026
Merged

FoldableContainer: Override has_point to use title rect when folded#110847
akien-mga merged 1 commit intogodotengine:masterfrom
StamLord:fix-foldablecontainer-pointer

Conversation

@StamLord
Copy link
Contributor

An attempt to fix #110834

Issue:

  • Mouse pointer still changes appearance when hovering over the invisible (folded) part of a FoldableContainer

Solution:

  • Override Control::has_point so that when folded, only the title rect is considered interactive. When unfloded, the default Control logic is used.

Notes:

  • I copied the title rect logic from FoldableContainer::gui_input. This rect is being created 4 times (including my addition) across _notification, gui_input and now has_point. It might be useful to cache this and update on some size change event, or at the very least refactor the logic into a helper function.

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.

Seems fine.

@akien-mga akien-mga changed the title FoldableContainer: Override has_point to use title rect when folded FoldableContainer: Override has_point to use title rect when folded Jan 1, 2026
@akien-mga akien-mga force-pushed the fix-foldablecontainer-pointer branch from 5e3aaee to fc7d6da Compare January 1, 2026 10:54
@akien-mga akien-mga added cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release and removed cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Jan 1, 2026
@akien-mga akien-mga merged commit 602d98b into godotengine:master Jan 1, 2026
20 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga
Copy link
Member

Cherry-picked for 4.5.2.

@akien-mga akien-mga removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Jan 16, 2026
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.

FoldableContainers are not resized when folded, and continue to handle gui input in the hidden areas.

3 participants

X Tutup