Commit Graph

678 Commits

Author SHA1 Message Date
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
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
f7f8af232c Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
ef5b9a06a9 Rename hint_tooltip to tooltip_text & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
f9f2446972 Merge pull request #64367 from Mickeon/rename-var-to-str
Rename `str2var` to `str_to_var` and similar
2022-08-26 23:04:06 +02:00
59e11934d8 Rename str2var to str_to_var and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
d93d646723 Merge pull request #64570 from KoBeWi/node🧳ing
Unify node casing adjustment
2022-08-26 09:49:58 +02:00
db227f85e8 Fix ruler lines rendering on top of text 2022-08-24 00:00:56 +03:00
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
fdab23163f Unify node casing adjustment 2022-08-18 14:08:40 +02:00
ccf088b40b Allow using numpad for zoom shortcuts in the 2D/code editors
This behavior is consistent with GIMP.
2022-08-10 15:07:47 +02:00
60677c4e95 Remove rect_ prefix from control properties when keyframing 2022-08-05 16:04:51 +02:00
0f9e84feab Merge pull request #50614 from foxydevloper/clarify-group-tooltip
Improve tooltips for grouping/ungrouping nodes
2022-08-02 15:56:27 +02:00
1c9ba5ef3e Remove excessive editor/property_editor.h includes 2022-08-01 17:19:11 +03:00
1ff9a09e2c Improve tooltips for grouping/ungrouping nodes 2022-07-31 10:56:32 -04:00
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
199ea349f5 Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
dabe021f19 Fix selection list in 2D editor 2022-07-21 12:24:02 +02:00
dcd64799ef Use FlowContainer to handle toolbar overflow more gracefully 2022-07-20 20:43:45 +03:00
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
87fb95f1ff Clear drag_selection when drag ends 2022-07-14 14:51:47 +02:00
38d8cb4782 Fix drag_selection crash on scene close 2022-07-14 02:31:52 +02:00
a319e6e623 Fix regressions from Font refactor
Fixes `p_font.is_null()` errors due to incorrect resource type used.
Fixes code editor font not set correctly, and OpenType features applied to the wrong font.
2022-07-07 15:11:08 +03:00
344ba0ffaf Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
072e2ff659 Show the transform operation numbers in 2D 2022-07-05 13:19:32 +02:00
e772b65d92 Remake resource thread safety and API
* Ensures thread safety when resources are destroyed.
* Simplified API by always forcing `ResourceCache::get_ref`, which needs less hacks and is fully thread safe.
* Removed RWLock for resources because its not possible to use for the new logic. Should not be a problem.

Supersedes #57533
2022-06-22 13:46:46 +02:00
0d6de213b4 [macOS] Fix high-precision scrolling direction in the canvas editor zoom. 2022-06-14 10:52:58 +03:00
9d9a50b7ee Fixed missing call to AnimationTrackEditor::make_insert_queue 2022-06-12 16:02:09 +02:00
ab2fd4a671 Merge pull request #59776 from fire-forge/more-round 2022-06-10 10:52:44 +02:00
c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02:00
ea9aaab293 Define zoom shortcut before using it 2022-06-07 21:27:38 +08:00
9172ab37bf Fix inverted mouse wheel zoom in CanvasItemEditor #61716
Bug introduced in bb07c6a7d0 while fixing symmetry of zooming in and out.
2022-06-05 16:29:59 +02:00
bb07c6a7d0 Fix zoom in callback for CanvasItemEditor to use correct numeric sign 2022-06-04 18:14:19 +02:00
42d1a96904 Add rounded corners to the contextual toolbar
- Move contextual toolbar stylebox to the editor theme because it's the same in the 2D and 3D editors
2022-05-25 15:43:40 -05:00
c2bf9c2802 Remove zoom_reset shortcut in 2D editor 2022-05-22 21:39:53 +02:00
743fce6834 Merge pull request #59242 from Sauermann/fix-editor-select-toplevel
Fix that Top Level CanvasItems are unselectable in editor
2022-05-17 08:22:12 +02:00
4cb74a5270 Fix that Top Level CanvasItems are unselectable in editor
Previously the parent Transform2D was included in the calculation
2022-05-17 01:36:28 +02:00
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
1dc7bcc83c Cleanup metadata usage 2022-05-06 00:27:10 +02:00
931838b330 Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
180e5d3028 Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
b831fb0a54 Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
de4c97758a Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
216fe8f8d9 Fix 2D editor menu position 2022-04-08 17:09:40 +02:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
d1207a0504 [Input] Add extra shortcut_input input processing step to process Unicode character input with Alt / Ctrl modifiers, after processing of shortcuts. 2022-04-05 13:46:45 +03:00
c331a3a614 Fix errors when locking nodes 2022-03-27 16:10:57 -03:00