164 Commits

Author SHA1 Message Date
Thaddeus Crews 42e4ec1c38 Merge pull request #118651 from StarryWorm/fix-tabbar-label-max-width
Fix `TabBar` and `Label` being unable to shrink when given a maximum size
2026-05-07 16:22:27 -05:00
StarryWorm 05737cd449 Add "desired size" to Control
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`.
2026-05-07 13:01:02 -04:00
Michael Alexsander 37da25dcb0 Make internal children of built-in nodes use their parent's material 2026-04-08 11:45:49 -03:00
StarryWorm bdca8b66e7 Add custom_maximum_size to Control
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.
2026-04-07 14:34:12 -04:00
Pāvels Nadtočajevs cdb35db426 Do not show accessibility configuration warnings for non-focusable controls, account for name fallback. 2026-03-13 08:53:09 +02:00
Rémi Verschelde 2dd1f4ef60 Decouple node.h from scene_tree.h, minimize its other includes 2026-03-05 13:54:46 +01:00
Rémi Verschelde eabb9a63d4 Rename callable_method_pointer.h to callable_mp.h and include it explicitly
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`.
2026-03-04 16:23:23 +01:00
Pāvels Nadtočajevs 1306221592 Move accessibility methods/enums from DisplayServer to the AccessibilityServer dedicated singleton. 2026-03-02 13:48:29 +02:00
Thaddeus Crews e380a41752 Style: Add class_db.h includes explicitly 2026-02-26 15:50:28 -06:00
kobewi f7b9703cbd Use actual class names in resource type hints 2026-01-29 21:07:56 +01:00
detomon 2d9b12acbf Fix accessibility name when right slot is enabled in GraphNode 2026-01-09 09:38:59 +01:00
Thaddeus Crews e53cbad0b1 Merge pull request #109322 from 4d49/graph-node-slot-meta
Add metadata for slots in `GraphNode`
2025-11-13 17:42:53 -06:00
detomon 5b1d82c9ac Fix drawing of slot icons in GraphNode when slots are not continuous 2025-10-31 14:20:37 +01:00
Mansur Isaev 4066281bab Add metadata for slots in GraphNode 2025-08-08 07:36:26 +04:00
Pāvels Nadtočajevs 71834ebbdd [GraphNode] Fix slot focus rect draw, make slot focus mode configurable. 2025-06-22 15:07:11 +03:00
Pāvels Nadtočajevs 5b49fd4207 Selectively apply FOCUS_ACCESSIBILITY to the Labels instead of setting it by default. 2025-04-23 12:47:31 +03:00
Thaddeus Crews 8ff4ea8a4a Merge pull request #97763 from Geometror/fix-gn-child-vis-conn-update
Fix `GraphEdit` connections not updating when a child of `GraphNode` goes invisible or changes size
2025-04-21 08:24:24 -05:00
Thaddeus Crews 11cb8140b8 Merge pull request #105370 from yuantianle/fix-graphnodes-connected-to-headers-rather-than-ports
Fix GraphNode frag/vert port positions misaligned
2025-04-16 10:45:16 -05:00
yuantianle 6e1fb68f65 Fix GraphNode frag/vert port positions misaligned
Issue conclusion: GraphNode port connections appear misaligned when switching between vertex and fragment modes, only realigning after zoom or layout refresh.

Investigation: The root cause was due to port positions being calculated before child layouts had finalized, resulting in inaccurate Y positions for ports. The original implementation relied on Control::position.y, which was not yet updated during the initial layout pass.

Explaination: This fix computes vertical offset using titlebar and stylebox sizes instead, ensuring port alignment is correct immediately after layout, without relying on zoom-triggered re-layouts.

Resolves: #105232

Add layout mode check to distinguish GraphEditor and ShaderGraphEditor

Fix port position calculation by distinguishing between GraphEditor and ShaderGraphEditor layouts.

Due to differences in layout flow and update timing (CPU vs GPU), ShaderGraphEditor requires manual vertical offset calculation, while standard GraphEditor can directly get the actual child positions after layout in run time.

This change adds a layout mode check (`is_using_resort_layout) to determine the appropriate method for computing port positions.

Fixed nits using cached values and removed redundant condition variable definition.

Add comment for the condition checking.
2025-04-15 14:25:05 -07:00
Hendrik Brucker 867fbd8be3 Fix GraphEdit connections not updating when a child of GraphNode goes invisible or changes size 2025-04-15 18:31:17 +02:00
Pāvels Nadtočajevs 5688d30439 Remove debug focus rect draws from MenuBar and GraphNode. 2025-04-12 21:05:18 +03:00
Pāvels Nadtočajevs 13cf88073b Fix graph node resizing. 2025-04-11 08:20:20 +03:00
Pāvels Nadtočajevs b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
Thaddeus Crews 8c32d5eee5 Merge pull request #103822 from ASamBlur/fix-graphnode-port-positions-for-expanded-children
Fix GraphNode port positions of children with size flag expand
2025-03-12 10:31:37 -05:00
A Thousand Ships 466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
ASamBlur 2d4c32b3ae Fix GraphNode port positions of children with size flag expand
- Changed slot_y_cache calculations in  _resort function so ports will be drawn correctly for expanded children.

- Similarly calculate the port_cache.pos in _port_pos_update function so the connection matches the port's position.
2025-03-08 19:29:29 +02:00
Janis Kirsteins 815e905972 Typo fix: rename SortableVisbilityMode 2025-01-19 00:33:39 +01:00
A Thousand Ships a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
Yufeng Ying 73d85f46c9 Remove unused headers in scene.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-12-24 00:40:09 +08:00
Gaktan 238859fe9d Fix graph node stretch not taking titlebar into account 2024-09-08 17:59:50 +02:00
kobewi 02e1e6d1ec Add visibilty mode to as_sortable_control() 2024-06-03 20:01:31 +02:00
Hendrik Brucker 62776842df [VisualShader] Add reroute node and improve port drawing 2024-05-13 03:26:01 +02:00
kobewi 5c28814b39 Add as_sortable_control() to unify Container checks 2024-05-08 11:45:52 +02:00
Rémi Verschelde a37db390e0 Merge pull request #90229 from Santoss1809/master
Fix error message when removing only child from GraphNode
2024-04-26 11:08:25 +02:00
João Santos eb9e193477 Fix error message when removing only child from GraphNode
Fixes #89695.
2024-04-26 10:45:45 +02:00
nagidev b0cafc1077 Fixed port cache calculation in GraphNode 2024-04-24 13:33:38 +05:30
Mansur Isaev 631d722674 Add set_slot_custom_icon and get_slot_custom_icon to GraphNode 2024-01-08 08:30:10 +01:00
Hendrik Brucker 9391046c32 Fix GraphNode slot index inconsistency. 2023-10-24 16:19:33 +02:00
Yuri Sizov fe000277ea Bind remaining theme properties to their respective classes
This adds binds for GraphEdit/GraphElement/GraphNode, which were
skipped before due to a rework. This also adds binds for Window,
which was skipped before due to a complicated code organization.

Also adds theme cache entries/direct cache access to a few places
that previously missed it. Some theme properties are now exposed
to other classes via friendships or public getters for convenience.

This removes all string-based theme access from scene/ classes.
2023-09-13 19:31:35 +02:00
Hendrik Brucker 5afe78bd9c Clean up/refactor GraphNode and make it more flexible
Split GraphNode into GraphElement and GraphNode, add custom
titlebar, and adjust theming.
2023-09-07 17:29:06 +02:00
Hendrik Brucker a38fd09669 Clean up/refactor GraphEdit 2023-07-24 18:37:23 +02:00
Hendrik Brucker 662d8c76b3 Remove GraphNode's comment property and related functionality
(this functionality will be reintroduced in a new and more flexible way)
2023-07-11 02:05:25 +02:00
lawnjelly b69c8b4791 Single Compilation Unit build.
Adds support for simple SCU build (DEV_ENABLED only).
This speeds up compilation by compiling multiple cpp files within a single translation unit.
2023-06-06 15:36:51 +01:00
Michael Alexsander 8118d0d2f5 Add more uses of appropriate cursors when resizing/moving some UI nodes 2023-05-07 11:14:57 -03:00
Johan Aires Rastén 9a60c4affb GraphNode ignore non-visible children for minimum size. 2023-04-05 09:05:52 +02:00
Michael Alexsander c567a853db Fix GraphNode resizing when its bottom border is too thin 2023-02-23 01:42:06 -03:00
Hendrik Brucker 62278eb236 Rename (de)selected signals to node_(de)selected in GraphNode 2023-01-12 04:08:06 +01:00
Juan Linietsky 47592927b3 Use BitField<> hint for ArrayFormat
This was missing in the conversion of bitflags to BitField<>.
2023-01-08 18:47:48 +01:00
Rémi Verschelde d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
zhangjianguo 8e1138d59a Prevent editor crash when deleting children of GraphNode 2022-11-30 09:25:26 +08:00