Commit Graph

224 Commits

Author SHA1 Message Date
22b5ec17fb Using iterator pattern instead of List::Element *.
Co-authored-by: Adam Scott <ascott.ca@gmail.com>
2025-03-28 13:29:15 +08:00
a20934c8e4 Optimize enumeration of global classes in create dialog and autocomplete 2025-01-29 09:39:50 +01:00
318af42020 Include more attributes in the global class names cache 2025-01-29 09:39:50 +01:00
a550eef9f3 Improve script class display in Create dialog 2025-01-03 00:19:25 +01:00
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
f241c1fda0 Remove unused header in editor.
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-12-24 00:40:38 +08:00
80d11500b5 Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
9c34ad1791 Add popup_create_dialog() for EditorInterface to create custom create dialog 2024-12-12 18:13:31 +08:00
0ff5d5fd04 Add theme type variations for secondary Trees and ItemLists 2024-11-19 18:33:30 +04:00
68f638cf02 Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
562c666e3d Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
14321b8ed5 Set auto translate mode for drag previews
- Controls
  - `LineEdit`, `TextEdit`: Always disabled since it's dragging user input.
  - `TabBar`: Use the same auto translate mode as the node.
  - `RichTextLabel`: Always disable since auto translation is done
    differently from other controls (selection text you get
    programmatically is always after auto translation).
- Editor
  - Disable drag preview auto translation if the text is user input,
    filename, or class name.
  - Also disabled unexpected auto translation for audio bus effect names.
2024-09-19 19:21:29 +08:00
74f64aaf98 Use InputMap actions consistently across all LineEdit's that filter an underlying Tree or ItemList.
- Instead of checking for Key::UP, Key::DOWN, Key::PAGEUP, Key::PAGEDOWN etc., we rather check for the action like 'ui_up' or 'ui_down'.
- Also use AcceptDialog's 'register_text_enter' functionality to consistently close a dialog when ENTER is pressed while the LineEdit has focus (instead of redirecting ENTER keys to e.g. the underlying Tree).
- Unify the LineEdit filter behavior for the SceneTreeDialog and corresponding usages
- Improve OK Button disablement (something should be selected)
2024-08-31 21:10:27 +02:00
5f695f0ab4 Rework global class hiding in addons 2024-06-25 12:38:27 +02:00
fbb879debd [Scene] Add SceneStringNames::text/value_changed 2024-06-19 09:44:38 +02:00
ca18a06ecb [Scene] Add SceneStringNames::confirmed 2024-06-19 09:40:54 +02:00
d9e2fc74c7 [Scene] Add SceneStringNames::item_selected 2024-06-19 09:39:05 +02:00
af6a4f300e Improve performance of the 'Create New Node' dialog
- Merged 3 for loops into 1 and save Vector allocation
- Use get_instance_base_type() or get_global_name() instead of get_language()->get_global_class_name() for performance considerations
- Use StringName where appropriate
2024-05-15 20:50:13 +02:00
ee79386f7b [Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +02:00
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
a0dbdcc3ab Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
a714cb9f65 Editor: Display deprecated/experimental messages in tooltips 2024-04-18 14:32:04 +03:00
c9407931b8 Disable Create button for abstract classes 2024-04-17 18:48:36 +02:00
8cd1ebbd6d Fix unexpected auto translation of Tree content 2024-03-18 09:31:00 +08:00
1638c1b28f Add const lvalue ref to editor/* container parameters 2024-02-26 15:28:15 -03:00
7b42c24550 Make auto translation inheritable 2024-02-15 16:51:19 -03:00
635b8a1474 Split theme generation logic into several subroutines
This change introduces a new theme configuration struct to be
passed to the aforementioned routines to better control reuse
of styles and definitions in the generator.

Everything not passed and not explicitly shared is scoped so it
is not automatically accessible throughout the routine. This
should ensure that the decision to share styles is a conscious one.

In the future we will try to reduce the number of unique definitions
and share most of it. This PR is a stepping stone on this path.

This also puts the effort into separating redefinitions of
default theme items vs custom types introduced only by the editor.
In a few cases where editor-specific definitions need to reference
default definitions we simply fetch them from the theme. It's not
ideal and hides the dependency a bit, but hopefully these cases
will be abstracted properly in due time.
2024-01-16 11:57:45 +01:00
95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
5eb22a317d Merge pull request #83577 from DennisManaa/fix-translation-for-item-list
Add automatic translation of items to ItemList
2024-01-04 16:39:36 +01:00
1a1c542836 Implement automatic translation for ItemList 2023-10-23 10:14:08 +02:00
9b03fb36f9 Improve threading in ClassDB and EditorHelp 2023-10-20 22:14:04 +02:00
ae91644c73 Revamp how documentation tooltips work 2023-10-03 17:40:51 -03:00
d759f91f8d Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-support
C#: Add abstract class support
2023-09-25 17:18:05 +02:00
2df37a237a C#: Abstract script class support 2023-09-15 20:35:25 -07:00
8ecc0c4f47 Fix accessing editor theme items throughout the UI
This also exposes `EditorInterface::get_editor_theme`.
2023-09-15 14:51:01 +02:00
786dab42fd Merge pull request #70329 from Daylily-Zeleen/daylily-zeleen/register_internal_class
Allow GDExtension to register unexposed classes.
2023-09-11 15:35:31 +02:00
41ffe5461f Allow GDExtension to register unexposed class. 2023-09-04 10:18:20 +08:00
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
398ca4e71a Use the gray color for all abstract classes 2023-08-31 12:59:18 +03:00
08118b1456 Only display 15 nodes in the Recent section of the Create New Node dialog
This prevents the history size from becoming too large, which made it less
useful.

This also fixes an off-by-one error in the completion scoring algorithm.
2023-06-23 23:51:51 +02:00
294b1a731a Merge pull request #63732 from DarkMessiah/create-new-node-arrow-navigation
Add arrow navigation for the Create New Node window
2023-05-29 12:21:29 +02:00
7b139e77e8 Add spacebar for folding in the Create New Node window 2023-05-28 12:48:34 +02:00
1522762dc9 Make icons of scripted and custom classes fit the editor UI
Also:
- Add an option to limit the icon size in PopupMenu.
This is similar to how this works in Tree and TreeItem.
- Add the same option to TabBar.
- Add a theme constant for Tree, PopupMenu, Button, and
TabBar to apply this limit on the control level.

Co-authored-by: Daylily-Zeleen <daylily-zeleen@foxmail.com>
2023-03-31 21:39:02 +02:00
894ce41180 Apply clamp_to_embedder on parent resize and popup.
Fixes #75084.

The clamp_to_embedder setting was added in 8be16e0704,
but was not set on any of the in-editor dialogs.

This patch sets `clamp_to_embedder` on editor dialogs so they cannot be dragged out of the frame.
This also modifies `clamp_to_embedder` so a window is clamped to the bounds of an embedder when
it pops up and when the parent is resized.
2023-03-27 07:08:29 -04:00
970f5533dd Fix filtering editor nodes in Create Dialog 2023-01-27 12:26:26 +01:00
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
274d49790d GDScript: Fix extending abstract classes, forbid their construction 2023-01-12 17:47:10 +02:00
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
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