Commit graph

467 commits

Author SHA1 Message Date
Yuri Sizov
9d3b4b0b40
Merge pull request #72204 from MinusKube/anchorable_rect_editor_bug
Fix get_parent_anchorable_rect() not returning the correct size in some cases
2023-02-06 16:28:19 +03:00
Markus Sauermann
3bc426c9d8 Fix toplevel nomenclature
toplevel was 3.x
top_level is 4.x
2023-02-02 17:37:41 +01:00
Rémi Verschelde
4cfdd25384
Merge pull request #67507 from Sauermann/fix-toplevel-root-control-node
Fix event propagation to child after set_as_toplevel
2023-01-31 15:55:46 +01:00
MinusKube
0f512a68dd Fix get_parent_anchorable_rect() not returning the correct size in some cases 2023-01-28 20:09:24 +01:00
Rémi Verschelde
f8d80b406d
Merge pull request #66688 from Sauermann/fix-control-get-global-rect-coordinates
Fix Control rect coordinate system inconsistency
2023-01-26 15:59:35 +01:00
Rémi Verschelde
65883cc73b
Merge pull request #71598 from bruvzg/gdscript_bidi_override
Implement BiDi override mode for GDScript source.
2023-01-19 19:33:18 +01:00
kobewi
c0083e431b Cleanup unused engine code v2 2023-01-19 13:02:18 +01:00
bruvzg
5361ec9f43
Implement BiDi override mode for GDScript source. 2023-01-18 19:22:20 +02:00
Rémi Verschelde
bcaf048f33
Merge pull request #71379 from KoBeWi/destruction_of_compatibility_function
Remove set_drag_forwarding_compat()
2023-01-18 17:40:13 +01:00
kobewi
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
stmSi
d1bd7539a6 Fix NaN value making infinite loop inside GraphEdit's NOTIFICATION_DRAW 2023-01-13 12:29:29 +06:30
Rémi Verschelde
3e2843e3ad
Merge pull request #71183 from YuriSizov/control-refresh-layouts-by-parents
Ensure that the cached layout mode is in sync
2023-01-11 01:29:51 +01:00
Yuri Sizov
42cbdbc7df Ensure that the cached layout mode is in sync 2023-01-10 23:51:27 +03:00
Juan Linietsky
e6a4debede Change set_drag_forwarding() to use callables.
* This solution is much cleaner than the one in 3.x thanks to the use of callables.
* Works without issues in any language (no need to worry about camel or snake case).
* Editor code uses a compatibility function (too much work to redo).

Fixes #59899
2023-01-10 14:09:24 +01:00
Yuri Sizov
00b5222f66 Fix inconsistent state of Controls when editing and running scenes 2023-01-09 15:54:04 +03: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
3579d7a9f7
Merge pull request #36301 from KoBeWi/daddy_node
Add reparent methods to Node
2023-01-07 13:20:56 +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
Juan Linietsky
80b578b060 Restore 'rotation_degrees' properties.
By popular demand, restoring the helper properties to rotate objects in degrees.
Affected are local and global rotations for:

* Node2D
* Node3D
* Control
2022-12-19 10:59:47 +01:00
Rémi Verschelde
92dfa7901b
Merge pull request #61855 from Calinou/popup-centered-minsize-fix-freeze
Fix infinite loop when calling `Control.popup_centered_minsize()`
2022-12-12 13:51:37 +01:00
Yuri Sizov
29cc86fa6c Copy local theme overrides from Control to Window 2022-12-07 20:50:51 +03:00
kobewi
b65a3a52ac Display transform properties of contained controls 2022-11-30 15:08:39 +01:00
Hendrik Brucker
e84f45fc93 Move z_index, z_as_relative and y_sort_enabled from Node2D to CanvasItem 2022-11-29 17:11:22 +01:00
Rémi Verschelde
438b2e2d02
Merge pull request #59801 from Sauermann/fix-node2d-viewport-root-order
Fix Viewport root order after Node2D raise
2022-11-28 08:21:10 +01:00
bruvzg
3add6dcd89
Add Control::localize_numeral_system property to toggle automatic numeral system conversion. 2022-11-17 14:59:56 +02:00
Markus Sauermann
022d24a9ae Fix Viewport root order after Node2D raise 2022-11-02 21:45:00 +01:00
Rémi Verschelde
5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde
be126d42d4
Merge pull request #67588 from KoBeWi/if(!GDVIRTUAL_CALL)don't
Simplify GDVIRTUAL_CALL calls
2022-10-31 11:55:56 +01:00
Clay John
4134f2a464
Merge pull request #67566 from Sauermann/fix-code-simplifications
Code simplifications
2022-10-23 17:02:04 -07:00
Markus Sauermann
99bb7ab692 Fix Control rect coordinate system inconsistency
Fix get_rect, get_global_rect and get_screen_rect to take Controls scale into
account.
Simplify get_screen_position and get_screen_rect
2022-10-22 01:47:52 +02:00
Max Hilbrunner
d148613bb1
Merge pull request #66279 from aaronfranke/control-min-size
Revert `custom_minimum_size` type back to `Vector2` instead of `Vector2i`
2022-10-19 22:40:52 +02:00
kobewi
d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann
b8031bb7d6 Code simplifications
1. Viewport::get_visible_rect().position is always zero.
So Control::get_window_rect is identical to Control::get_global_rect.
Remove Control::get_window_rect since it is not used in the source code.

2. sqrt(a * a) = abs(a) for doubles

3. Simplify affine_inverse combination

4. Simplify calculation in shaders
2022-10-18 12:47:40 +02:00
Markus Sauermann
13b87c13c7 Fix set_as_toplevel event propagation to child
In certain conditions events did not get propagated to Control childs of
Node2D nodes when setting a parent of the Node2D to toplevel.

This patch makes sure that such Control nodes become root control in the
viewport.
2022-10-16 21:42:16 +02:00
Eric M
a3ed9e6f2c Move Shortcut Context to Control and ensure that shortcut_input adheres to contexts. Also ensure that controls with no context are only triggered AFTER nodes which do have a context. 2022-10-13 21:07:19 +10:00
Rémi Verschelde
fad0327503 Merge pull request #66953 from Sauermann/fix-top-level-connect-error
Fix Control node not disconnecting from signal
2022-10-13 09:04:25 +02: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
Markus Sauermann
c0f0f26615 Fix Control not disconnecting signal
If a Control has not parent CanvasItem and is set as top_level, then it does not disconnect from the "size_changed" signal when it leaves the Canvas.
This patch corrects this.
2022-10-05 23:35:44 +02:00
Rémi Verschelde
e3464c8fc8 Merge pull request #58995 from Sauermann/fix-mouse-cursor-change-2
Update mouse cursor shape after changes
2022-09-28 20:50:05 +02:00
Aaron Franke
c3970f8fe5
Revert custom_minimum_size type back to Vector2 instead of Vector2i 2022-09-22 19:09:12 -05:00
Marc Gilleron
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
Markus Sauermann
52da6f1a44 Update mouse cursor shape after changes
This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
2022-09-18 17:15:38 +02:00
Michael Alexsander
c4c9e41073 Make Vector2i values paired with EDSCALE be just Vector2 2022-09-08 14:46:32 -03:00
Micky
dd26ecdd31 Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOT
For consistency. Every other exposed `one_shot` is spaced out like this.
2022-09-06 19:00:33 +02:00
Rémi Verschelde
597bc949a4 Merge pull request #65250 from YuriSizov/theme-owner-rises 2022-09-02 23:20:49 +02:00
Yuri Sizov
8b128081e8 Un-defer the initial theme changed notification
Co-authored-by: Rindbee <idleman@yeah.net>
2022-09-02 23:44:23 +03:00
Yuri Sizov
ddc55ef746 Add ThemeOwner type for managing theme propagation and lookup 2022-09-02 23:44:23 +03:00
Hugo Locurcio
f7292dbeb3
Rename or_lesser range property hint to or_less
"less" should be used for quantity, rather than "lesser".

Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
2022-09-02 19:08:20 +02:00
Yuri Sizov
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +03:00