virtualx-engine/scene/gui
Rémi Verschelde 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
..
aspect_ratio_container.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
aspect_ratio_container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
base_button.cpp Fix some corner cases in the Menu/OptionButton item auto-highlight 2022-08-28 01:15:03 -03:00
base_button.h Merge pull request #64635 from YeldhamDev/menu_buttons_popup_fix 2022-08-24 19:07:25 +02:00
box_container.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
box_container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
button.cpp Fix case where h_separation might not work in Button 2022-08-12 19:57:08 +08:00
button.h Add fit_to_longest_item to OptionButton 2022-08-02 23:37:43 +02:00
center_container.cpp Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
center_container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
check_box.cpp Fix case where h_separation might not work in Button 2022-08-12 19:57:08 +08:00
check_box.h Style: Remove inconsistently used @author docstrings 2022-01-04 20:42:50 +01:00
check_button.cpp Fix case where h_separation might not work in Button 2022-08-12 19:57:08 +08:00
check_button.h Add optional constructor arguments to more Control nodes 2022-03-04 09:48:41 +01:00
code_edit.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
code_edit.h Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
color_mode.cpp Fix Hue slider incorrectly rotated 90 degrees in ColorPicker 2022-08-04 11:30:03 +08:00
color_mode.h ColorPicker Refactor 2022-07-06 22:11:43 +05:30
color_picker.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
color_picker.h Fix ColorPicker color and hsv sync issue 2022-08-01 23:05:44 +02:00
color_rect.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
color_rect.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
container.cpp String: Remove TTR and DTR defines in non-tools build 2022-03-28 20:26:35 +02:00
container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
control.cpp Rename hint_tooltip to tooltip_text & setget 2022-08-27 01:35:01 +02:00
control.h Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
dialogs.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
dialogs.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
file_dialog.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
file_dialog.h Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
flow_container.cpp Replace most uses of Map by HashMap 2022-05-16 10:37:48 +02:00
flow_container.h Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
gradient_edit.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
gradient_edit.h Color Pickers Respect Settings 2022-07-21 18:11:09 -04:00
graph_edit.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
graph_edit.h Add read-only mode to AnimationTreeEditor plugins 2022-08-25 16:29:36 +01:00
graph_node.cpp Merge pull request #63249 from V-Sekai/animation_tree_editor_read_only 2022-08-27 08:14:30 +02:00
graph_node.h Merge pull request #63249 from V-Sekai/animation_tree_editor_read_only 2022-08-27 08:14:30 +02:00
grid_container.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
grid_container.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
item_list.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
item_list.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
label.cpp Reorganized Label and RichTextLabel properties 2022-08-28 10:26:04 +02:00
label.h Rename Label & RichTextLabel.percent_visible to visible_ratio 2022-08-26 12:15:57 +02:00
line_edit.cpp Merge pull request #62771 from bruvzg/line_edit_trim 2022-08-26 11:43:28 +02:00
line_edit.h Merge pull request #62771 from bruvzg/line_edit_trim 2022-08-26 11:43:28 +02:00
link_button.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
link_button.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
margin_container.cpp Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
margin_container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
menu_bar.cpp Add item auto-highlighting to MenuBar 2022-08-28 01:49:22 -03:00
menu_bar.h Add item auto-highlighting to MenuBar 2022-08-28 01:49:22 -03:00
menu_button.cpp Fix some corner cases in the Menu/OptionButton item auto-highlight 2022-08-28 01:15:03 -03:00
menu_button.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
nine_patch_rect.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
nine_patch_rect.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
option_button.cpp Fix some corner cases in the Menu/OptionButton item auto-highlight 2022-08-28 01:15:03 -03:00
option_button.h Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
panel.cpp Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
panel.h Fix theming for floating window docks 2022-02-07 09:55:25 -03:00
panel_container.cpp Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
panel_container.h Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
popup.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
popup.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
popup_menu.cpp Merge pull request #64960 from YeldhamDev/more_hl_stuff 2022-08-29 08:05:33 +02:00
popup_menu.h Implement MenuBar control to wrap PopupMenus or native menu, use native menu for editor. 2022-08-18 22:25:44 +03:00
progress_bar.cpp Fix ProgressBar's minimum size not updating when toggling its percent_visible 2022-06-25 15:39:39 +08:00
progress_bar.h Add fill_mode to ProgressBar 2022-05-10 19:34:48 +08:00
range.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
range.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
reference_rect.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
reference_rect.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
rich_text_effect.cpp Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
rich_text_effect.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
rich_text_label.cpp Reorganized Label and RichTextLabel properties 2022-08-28 10:26:04 +02:00
rich_text_label.h Rename Label & RichTextLabel.percent_visible to visible_ratio 2022-08-26 12:15:57 +02:00
scroll_bar.cpp Remove Signal connect binds 2022-07-29 16:26:13 +02:00
scroll_bar.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
scroll_container.cpp Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
scroll_container.h Fix toggling after scrolling resulted in blank space 2022-07-31 09:32:20 +08:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
separator.cpp Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
separator.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
slider.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
slider.h Consistently use double in Slider and SpinBox 2022-07-15 15:47:47 -05:00
spin_box.cpp Merge pull request #64574 from Begah/fix_transient_window_wrap_mouse 2022-08-26 13:54:23 +02:00
spin_box.h Hide prefix/suffix on SpinBox focus 2022-08-17 13:32:25 +02:00
split_container.cpp Revert SplitContainer minimum size splitting changes (#64676 and #64800) 2022-08-26 15:57:17 +02:00
split_container.h Revert SplitContainer minimum size splitting changes (#64676 and #64800) 2022-08-26 15:57:17 +02:00
subviewport_container.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
subviewport_container.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
tab_bar.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
tab_bar.h Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
tab_container.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
tab_container.h Fix getting outdated tab controls 2022-07-18 20:06:21 +08:00
text_edit.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
text_edit.h Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
texture_button.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
texture_button.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
texture_progress_bar.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
texture_progress_bar.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
texture_rect.cpp Add some codes, returnes directly if the value is not changed. 2022-08-23 23:25:22 +08:00
texture_rect.h Rename TextureRect.expand to ignore_texture_size 2022-01-07 20:21:17 +01:00
tree.cpp Merge pull request #64536 from Mickeon/editor-tree-icon-size 2022-08-25 09:56:08 +02:00
tree.h Replace Array return types with TypedArray 3 2022-08-24 12:53:36 +02:00
video_stream_player.cpp Rename str2var to str_to_var and similar 2022-08-26 14:58:22 +02:00
video_stream_player.h Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
view_panner.cpp Remove Signal connect binds 2022-07-29 16:26:13 +02:00
view_panner.h Fix 2D Pan Tool 2022-01-24 22:21:19 +01:00