Commit Graph

4088 Commits

Author SHA1 Message Date
Rémi Verschelde e60086f98b
Merge pull request #64119 from YuriSizov/theme-init-database 2022-08-29 14:02:21 +02:00
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
Rémi Verschelde 223e083d36
Merge pull request #64964 from MewPurPur/reorganize-label-properties
Reorganize Label and RichTextLabel properties
2022-08-29 09:52:04 +02:00
Rémi Verschelde f647292df5
Merge pull request #64960 from YeldhamDev/more_hl_stuff 2022-08-29 08:05:33 +02:00
Rémi Verschelde 34f45d7b28
Merge pull request #64967 from YeldhamDev/pm_up_fix 2022-08-29 07:56:03 +02:00
Rémi Verschelde 93cf259834
Merge pull request #64972 from YeldhamDev/you_too_menubar 2022-08-29 07:55:46 +02:00
Rémi Verschelde 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
VolTer 832950d1f2 Reorganized Label and RichTextLabel properties 2022-08-28 10:26:04 +02:00
Michael Alexsander 44c64b912f Add item auto-highlighting to `MenuBar` 2022-08-28 01:49:22 -03:00
Michael Alexsander 221344b9e2 Fix some corner cases in the `Menu/OptionButton` item auto-highlight 2022-08-28 01:15:03 -03:00
Michael Alexsander 06df59887b Fix crash when pressing up on an empty `PopupMenu` 2022-08-27 18:13:27 -03:00
Rémi Verschelde d3db8bbebd
Merge pull request #62846 from AaronRecord/remove_redundant_theme_updates_in_enter_tree
Remove `NOTIFICATION_ENTER_TREE` when paired with `NOTIFICATION_THEME_CHANGED`
2022-08-27 21:56:14 +02:00
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06: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
Micky 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
Rémi Verschelde 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
Rémi Verschelde 4f60fd0480
Merge pull request #64777 from bruvzg/extend_to_title
[macOS] Extend editor contents to the window title bar for better space usage.
2022-08-26 23:03:31 +02:00
Yuri Sizov 6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00
Rémi Verschelde ecfff5b75e Revert SplitContainer minimum size splitting changes (#64676 and #64800)
This reverts commits 185b1a5bd3 and 19ad31b89f.

The original PR and its fixup still had regressions, so we're going back
to the drawing board to reattempt fixing #43749.

Fixes #64785.
Fixes #64851.
Fixes #64866.
2022-08-26 15:57:17 +02:00
Micky 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
Rémi Verschelde c8ef12a03a
Merge pull request #64665 from Mickeon/rename-label-visible 2022-08-26 14:54:37 +02:00
bruvzg bc4ba6cb78
[macOS] Extend editor contents to the window titlebar for better space usage. 2022-08-26 15:12:43 +03:00
Rémi Verschelde ff612b6916
Merge pull request #64574 from Begah/fix_transient_window_wrap_mouse 2022-08-26 13:54:23 +02:00
Rémi Verschelde 0c639428dd
Merge pull request #64529 from KoBeWi/suffix_begone 2022-08-26 13:39:14 +02:00
Micky 64bd36ecee Rename Label & RichTextLabel.`percent_visible` to `visible_ratio`
Also updates the documentation of both `visible_characters` and `visible_ratio` to, better describe what they do and improve consistency between the two Classes.
2022-08-26 12:15:57 +02:00
Rémi Verschelde ac7b5111f5
Merge pull request #64768 from bruvzg/popups_hide_if_visible 2022-08-26 11:59:50 +02:00
Rémi Verschelde fed1189099
Merge pull request #62771 from bruvzg/line_edit_trim 2022-08-26 11:43:28 +02:00
Aaron Record 74eb2a70bd Refactor and remove excessive calls of `NOTIFICATION_THEME_CHANGED` 2022-08-25 14:50:49 -06:00
SaracenOne 75f1357ced Add read-only mode to AnimationTreeEditor plugins 2022-08-25 16:29:36 +01:00
MathieuRoux 5ac5c8bc06 Fix warp_mouse for transient windows, smoother mouse positioning when releasing mouse for spinbox 2022-08-25 11:30:49 +02:00
Rémi Verschelde 0a5f5c8558
Merge pull request #64536 from Mickeon/editor-tree-icon-size
Account for TreeItem's Cell icon and center the text Popup vertically
2022-08-25 09:56:08 +02: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
Rémi Verschelde efedef8eb1
Merge pull request #64837 from YuriSizov/control-disconnect-from-everything-and-free-yourself
Disconnect Control from theme resources to avoid issues on destruction
2022-08-25 00:04:17 +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
Rémi Verschelde b7d2ba12c8
Merge pull request #64635 from YeldhamDev/menu_buttons_popup_fix
Make `Menu/OptionButton` item auto-highlight behave better
2022-08-24 19:07:25 +02:00
Yuri Sizov bb5fa91a6b Disconnect Control from theme resources to avoid issues on destruction 2022-08-24 18:50:04 +03:00
Rémi Verschelde 4698dc67b5
Merge pull request #64082 from KoBeWi/array3k 2022-08-24 16:05:59 +02:00
Yuri Sizov 5d14d08702
Merge pull request #59226 from Rindbee/better-setters-in-gui-controls
Improve the setters in gui, return directly if the value does not change.
2022-08-24 17:03:54 +03:00
Yuri Sizov 78f3e4cb6a
Merge pull request #64369 from derammo/derammo_tree_right_click_title
Replace Tree control left click on title signal with new signal for either left or right click
2022-08-24 16:16:53 +03:00
derammo 0ba2e999df implemented right click on Tree control header 2022-08-24 08:10:40 -04:00
kobewi f7f4873ed0 Replace Array return types with TypedArray 3 2022-08-24 12:53:36 +02:00
Rémi Verschelde c3a8ec3cbb
Merge pull request #64800 from KoBeWi/split_hax
Handle child control size changes in SplitContainer
2022-08-24 09:50:46 +02:00
Rémi Verschelde 854eb58074
Merge pull request #64783 from bruvzg/fix_rtl_min_size
Fix RTL min. size not triggering text cache update.
2022-08-24 09:49:00 +02:00
Rémi Verschelde 91e5f48ea7
Merge pull request #64009 from KoBeWi/arrayy_lmao
Replace Array return types with TypedArray (part 2)
2022-08-24 08:18:56 +02:00
kobewi 1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00
kobewi 19ad31b89f Handle child control size changes in SplitContainer 2022-08-23 20:41:10 +02:00
Rémi Verschelde bbe8d2b03e
Merge pull request #64767 from bruvzg/meta_click 2022-08-23 18:15:44 +02: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
bruvzg f02d45ce0c
Fix RTL min. size not triggering text cache update. 2022-08-23 16:27:45 +03:00
Rémi Verschelde 11506eb24d
Merge pull request #64676 from KoBeWi/split_and_conquer 2022-08-23 10:28:09 +02:00