Commit graph

53 commits

Author SHA1 Message Date
A Thousand Ships
75ee58fd04 [Editor] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-15 20:15:39 +02:00
Haoyu Qiu
b8b0339549 Improve undo action names
* Avoid concating strings manually for better i18n and easy l10n
   * Use `vformat` when possible
   * Use separate strings if the changing part is only a few hardcoded strings
* Don't put a period at the end of the name
2023-09-12 18:53:50 +08:00
kobewi
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
Haoyu Qiu
997ff8f14a Translate undo/redo messages in settings dialogs 2023-04-23 17:49:55 +08:00
Ryan Roden-Corrent
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
Rémi Verschelde
bcaf048f33
Merge pull request #71379 from KoBeWi/destruction_of_compatibility_function
Remove set_drag_forwarding_compat()
2023-01-18 17:40:13 +01:00
kobewi
b58111588a Add EditorUndoRedoManager singleton 2023-01-16 01:11:52 +01:00
kobewi
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
Juan Linietsky
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
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
Rémi Verschelde
2fadc1299d
Merge pull request #67871 from Calinou/editor-theme-add-oled-preset
Add Black (OLED) editor theme preset
2022-11-28 08:46:12 +01:00
kobewi
538b84d41a Don't update EditorSettings dialog unnecessarily 2022-11-21 14:47:16 +01:00
Rindbee
12787ad57d Fix memory leak in EditorSettingsDialog
Delete `TreeItem`s that are not in `Tree`, `TreeItem` needs to be deleted manually.
2022-11-11 14:21:46 +08:00
kobewi
15831e381b Unify usage of undo_redo in editor 2022-11-02 17:51:58 +01:00
Hugo Locurcio
f613db0db9
Add Black (OLED) editor theme preset
This preset uses a fully black background to reduce power usage on OLED
displays, leading to increased battery life on laptops with OLED displays.

This preset is also useful for late night sessions, as OLED displays
have a near-infinite contrast ratio.

This also adds a Draw Extra Borders editor setting which draws borders
around some interactive nodes. This setting is required for good
usability of a theme with a fully black background.

Visibility of disabled text (including unselected tab names) has been
slightly increased for better accessibility, regardless of the editor
theme preset in use.
2022-10-26 01:23:53 +02:00
Eric M
598ee4266c Split action_map_editor file into one file per class it contained.
* ActionMapEditor
* EventListenerLineEdit
* InputEventConfigurationDialog
2022-10-06 18:29:20 +10:00
EricEzaM
cb6d7fd059 Add searching by event for Editor Settings shortcuts and Project Settings input map.
* Focus into the LineEdit, then perform input to search the list of events by the events assigned.
* New specialised editor-only control for this: EventListenerLineEdit. Line edit is a good candidate for such a control because you can focus it, override it's input handling, and show the event all in one control.
Update InputEventConfigurationDialog to use event listener line edit rather than the separate tabs.
* Cleaner look - no need for tabs.
* Simpler code.
2022-10-03 19:56:34 +10:00
Rémi Verschelde
919d8b3711 Merge pull request #65290 from requizm/fix/65081/cannot_set_escape
Disabled "Escape" button when closing the shortcut window
2022-09-25 11:06:18 +02:00
Eric M
722378479d Update Editor Shortcuts tree creation to always have sections in same order. 2022-09-17 11:41:15 +10:00
Eric M
badea350ac Check TreeItem for nullptr before accessing. 2022-09-15 23:50:52 +10:00
bruvzg
6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +02:00
Yuri Sizov
43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
requizm
1c2464a557 Disabled "Escape" button when closing the shortcut window 2022-09-03 18:22:12 +03:00
Micky
97f8c9b97c Rename TreeItem's set_tooltip to set_tooltip_text
`set_tooltip` -> `set_tooltip_text`
`get_tooltip` -> `get_tooltip_text`

For consistency:
`get_button_tooltip` -> `get_button_tooltip_text`
And the `tooltip` parameter in `add_button` was renamed to `tooltip_text`
2022-08-30 11:16:23 +02:00
kobewi
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
FireForge
e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
Rémi Verschelde
532e253a7c
Merge pull request #61455 from fire-forge/tab
Add color contrast to TabContainer backgrounds in the editor
2022-05-31 12:52:03 +02:00
FireForge
7f7244f04a Use consistent casing in editor filter/search bars 2022-05-28 18:43:16 -05:00
FireForge
eb573da2b5 Use "odd" style for TabContainers on base BG color
- Use the "odd" style for TabContainers that are on a background with the same color as the default TabContainer background color to add contrast
2022-05-26 21:19:15 -05:00
trollodel
307427af89 Add the button pressed to some signals in Tree 2022-05-21 17:16:52 +02:00
reduz
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
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
kobewi
1dc7bcc83c Cleanup metadata usage 2022-05-06 00:27:10 +02:00
bruvzg
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
Haoyu Qiu
ccde2bf66f Add property name style toggle to Inspector 2022-03-28 18:52:09 +08:00
Michael Alexsander
deb1342036 Make TabBar/Container default their alignments to the left instead of center 2022-03-17 18:12:23 -03:00
Aaron Franke
918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
Rémi Verschelde
7e4a8d3ab3
Merge pull request #58706 from timothyqiu/property-i18n 2022-03-10 21:09:50 +01:00
Rémi Verschelde
90faf04f29
Merge pull request #56476 from gerhean/fix_shortcut_collapse_after_edit 2022-03-10 12:49:27 +01:00
kobewi
3203a2b4bb Fix color pickers closing in editor settings 2022-03-05 13:25:32 +01:00
Rémi Verschelde
cdd63fa872
Merge pull request #53839 from EricEzaM/editor-settings-changed-settings
Added ability to get list of editor settings changed when saving editor settings. Optimised settings changed notification.
2022-03-05 12:54:38 +01:00
Eric M
daceae79e8 Made use of EditorSettings 'settings changed' to optimise settings changed notifications. 2022-03-05 19:26:40 +10:00
Michael Alexsander
a811ebf699 Make TabContainer use TabBar internally 2022-03-03 21:49:58 -03:00
Haoyu Qiu
d6df2ffad8 i18n: Make property paths and categories translatable 2022-03-03 18:31:40 +08:00
Eric M
f6edd2d2a0 Fixed issues with shortcut checking in 3d node editor
The freelook shortcuts now use the action system by proxy. This allows the actions system to be leveraged for input checking. When the shortcut changes, the respective action is updated.
2022-02-18 23:19:22 +10:00
jmb462
dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde
6eeeb9a63c
Re-add missing SNAME macros in get_theme_* calls
They were removed in the previous commit reverting the addition of `SNAME`
to `add_theme_*` and theme setter methods, which is not wanted.
2022-02-08 10:31:56 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00