A `Control` can define `get_desired_size()` which allows it to grow based on its content without increasing its minimum size.
This new size will be respected by parent `Container`s.
Currently used by `Label` and `TabBar`.
This change enables `ScrollContainer` to make full use of the newly added `custom_maximum_size`. This mode behaves like `SCROLL_MODE_AUTO` but prioritizes expanding the size of the `ScrollContainer` up to its `custom_maximum_size` before displaying scroll bars.
This property mirrors `custom_minimum_size` and enables the user to set a size the `Control`. Enabling `propagate_maximum_size` forces all children to respect this node's maximum_size.
Not all `Control` types handle this gracefully, which may result in content clipping.
This allows removing it from `class_db.h`, significantly reducing the amount of files
that include it transitively.
Also includes some include cleanup in `control.h` and `rich_text_label.h` done while
ensure they don't depend on `callable_mp`.
Adds ROLE_REGION to allow controls to be marked as accessibility
regions/landmarks.
- Add `accessibility_region` property to Control
- Add ROLE_REGION to DisplayServer and AccessKit mapping
- Prevent Container/ScrollContainer from overriding region role
- Fix TabContainer to update accessibility when tabs change
- Mark editor docks, main screen, bottom panel, and scene tabs as regions
GLOBAL_GET is an expensive operation which should not be used each frame / tick.
This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
Fixes#100176
Instead of using no clipping technique to draw the focus border because
it causes problems if a `ScrollContainer` is nested in another
`ScrollContainer`, now the focus border is drawn using an internal
`PanelContainer`.
Calculate based on the `ScrollContainer`'s space to eliminate possible
rotation. The global rect already has applied the rotation, so it
should not be used.