Commit Graph

180 Commits

Author SHA1 Message Date
Marius Hanl 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
Marius Hanl ff9946f817 Make ThemeTypeDialog List navigatable when the LineEdit selected
This behavior is the same as in the CreateDialog.
The arrow keys or page up/page down navigate the List while the LineEdit has focus.
2024-08-28 12:57:49 +02:00
A Thousand Ships fbb879debd
[Scene] Add `SceneStringNames::text/value_changed` 2024-06-19 09:44:38 +02:00
A Thousand Ships ca18a06ecb
[Scene] Add `SceneStringNames::confirmed` 2024-06-19 09:40:54 +02:00
A Thousand Ships d9e2fc74c7
[Scene] Add `SceneStringNames::item_selected` 2024-06-19 09:39:05 +02:00
A Thousand Ships d519715d94
[Scene] Add `SceneStringNames::font(_size/_color)` 2024-06-18 17:24:27 +02:00
A Thousand Ships 926afccbd8
[Scene] Add `SceneStringNames::panel` 2024-05-30 22:54:50 +02:00
A Thousand Ships ee79386f7b
[Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +02:00
kobewi 413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
kobewi d7bedcdf43 Fallback to default theme for variation items 2024-05-10 13:16:29 +02:00
A Thousand Ships b4c6cc7d82
[Core] Add case-insensitive `String::containsn` 2024-05-08 12:48:01 +02:00
Danil Alexeev a714cb9f65
Editor: Display deprecated/experimental messages in tooltips 2024-04-18 14:32:04 +03:00
Haoyu Qiu 8cd1ebbd6d Fix unexpected auto translation of Tree content 2024-03-18 09:31:00 +08:00
Hugo Locurcio 8221e7546b
Add editor shortcuts to toggle bottom panel visibility
Default shortcuts use the first or second letter of each word.

This also adds a new shortcut to toggle the last opened bottom panel.
On editor startup, this defaults to the first panel in the list
(which is the Output panel).
2024-03-05 15:53:15 +01:00
kit eb6ca91ba6 Extract BottomPanel from EditorNode 2024-02-20 15:09:07 -05:00
Michael Alexsander 7b42c24550
Make auto translation inheritable 2024-02-15 16:51:19 -03:00
kobewi e86750dcaa Fetch theme editor items from ThemeDB 2024-01-31 13:17:11 +01:00
Yuri Sizov 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
Yuri Sizov 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
Muller-Castro 96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
Rémi Verschelde 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
kobewi fc7cdd5c37 Disable Add button when theme item name is empty 2023-12-11 22:21:36 +01:00
DennisManaa 1a1c542836 Implement automatic translation for ItemList 2023-10-23 10:14:08 +02:00
Haoyu Qiu 26b21f110a Don't auto translate theme type list 2023-10-12 10:04:53 +08:00
Rémi Verschelde 49e2bd9d5b
Merge pull request #81523 from KoBeWi/epic_self_roast
Allow contextual plugins to persist temporarily
2023-10-06 16:50:53 +02:00
kobewi a6de7a8a3f Allow contextual plugins to persist temporarily 2023-10-06 15:58:50 +02:00
Michael Alexsander 34e6b86134
Show doc tooltips when hovering properties in the theme editor 2023-10-04 11:53:08 -03:00
Yuri Sizov 5e3229b7ed Fix leak when closing theme editor preview tabs 2023-09-27 15:29:20 +02:00
MewPurPur fb030beac5 Add white Font and Mesh icons 2023-09-25 17:29:14 +03:00
Yuri Sizov 8ecc0c4f47 Fix accessing editor theme items throughout the UI
This also exposes `EditorInterface::get_editor_theme`.
2023-09-15 14:51:01 +02:00
Yuri Sizov 512182f147 Add theme contexts to various parts of the editor
This change defines additional theme contexts for editor
branches to prevent theme leaking between the default
theme, the project theme, and the editor theme.

- Both editor window and EditorNode define an editor-specific
context with the editor theme and the default theme.
- The 2D viewport defines a project-specific context with
the project theme and the default theme.
- Theme editor preview tabs define the default-only context
with the default theme.

Additionally, the default theme context now only includes
the project theme for running projects (both export and debug).
This prevents the project theme from leaking into the editor.

This commit also does a little clean up on the theming aspects
of the EditorNode.
2023-09-06 19:40:43 +02:00
kobewi 6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
jsjtxietian ba41910967 Use ui_text_submit to confirm and close text prompts
Fix press space when enter editor layout name will
confirm and save layout, same in theme editor
2023-09-01 12:23:30 +08:00
kobewi de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
Arman Elgudzhyan 8ab2cf3d2d Use defined key mapping for closing popups and dialogs
As opposed to hardcoding the escape key. Also removed such hardcoding in a few other places as well as a hardcoded enter key in one of the affected input fields.
2023-05-20 17:39:59 -07:00
Yuri Sizov 4154039832 Improve includes of EditorNode (and everything else)
Also start organizing editor-specific GUI components
into a dedicated folder, `editor/gui`.
Also move `editor_file_server` next to the rest of debugger classes.
2023-04-07 18:59:49 +02:00
Yuri Sizov 5a3dbea3ed Add missing handler for removing font sizes in Themes 2023-03-07 13:42:42 +01:00
rsjtdrjgfuzkfg 331dd33009 Theme Editor: fix leading styleboxes / main styles
Recent changes in Godot cause the theme editor to become hidden when
editing a child resource. This causes a crash when editing style box
resources marked as "main styles" (= leading styleboxes in the code), as
they try to reference the currently edited theme.

This commit works around the issue by permitting the Theme Editor to
keep a reference to the most recently edited Theme. Furthermore, it adds
an assertion to avoid a similar crash in the future.

Long-term, the workaround should probably be removed when the theme editor
is fixed to remain visible while editing child resources, but I'd keep
the assertion.
2023-02-16 20:41:51 +01:00
Yuri Sizov 18d6c91e8e Avoid cleaning up editor plugins when property list changes
Also removes a usability hack from the Theme editor, as it doesn't work anymore,
and it confuses the Inspector.
2023-02-11 14:38:07 +01:00
kobewi 80723d2537 Fix handling of nulls in some editors 2023-01-23 09:59:48 +01:00
kobewi b58111588a Add EditorUndoRedoManager singleton 2023-01-16 01:11:52 +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
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Rémi Verschelde d1a155e3cd Fix various -Wmaybe-uninitialized warnings from GCC 12.2.1
Not sure why I didn't get those before, it may be due to upstream
changes (12.2.1 is a moving target, it's basically 12.3-dev), or simply
rebuilding Godot from scratch with different options.
2022-09-22 11:29:48 +02:00
Michael Alexsander c4c9e41073 Make `Vector2i` values paired with `EDSCALE` be just `Vector2` 2022-09-08 14:46:32 -03:00
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 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
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00