Commit graph

150 commits

Author SHA1 Message Date
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
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Yuri Sizov
29c8504dd9 Improve parameter naming and documentation in GraphEdit and GraphNode
Co-authored-by: Maganty Rushyendra <mrushyendra@yahoo.com.sg>
2022-09-09 17:50:44 +03:00
Maxim Kulkin
9a35ede23f Add GraphNode 'selected' and 'deselected' signals, simplify GraphEdit 2022-09-05 02:32:06 -04:00
Micky
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
Rémi Verschelde
f9998455ce
Merge pull request #63249 from V-Sekai/animation_tree_editor_read_only
Add read-only mode to AnimationTreeEditor plugins
2022-08-27 08:14:30 +02:00
SaracenOne
75f1357ced Add read-only mode to AnimationTreeEditor plugins 2022-08-25 16:29:36 +01:00
Rémi Verschelde
1adcd0327f
Merge pull request #64806 from Zylann/graph_node_protected_validate_property
Make GraphNode::_validate_property protected so GraphNode can be inherited
2022-08-25 07:30:42 +02:00
Marc Gilleron
22fcdffd17 Make GraphNode::_validate_property protected so GraphNode can be inherited.
It's not about overriding or accessing `_validate_property`,
but since `_validate_property` became a multilevel method,
the GDCLASS macro now tries to access the one from the parent class,
which causes a compiling error if the parent class declares
`_validate_property` as private.
2022-08-24 21:29:32 +01:00
风青山
e561c68256 Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
2022-08-23 23:25:22 +08:00
Yuri Sizov
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
Hakim
60677c4e95 Remove rect_ prefix from control properties when keyframing 2022-08-05 16:04:51 +02:00
kobewi
9a2758e374 Fix GraphNode slot list 2022-08-02 15:39:56 +02:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00