Commit graph

76 commits

Author SHA1 Message Date
Rémi Verschelde
88b347dc27
Merge pull request #51920 from jmb462/missing-sname-macro-optimization-in-some-functions 2021-09-23 13:14:20 +02:00
kobewi
a913ae8d56 Add support for internal nodes 2021-08-28 02:07:23 +02:00
jmb462
54de7114c5 Add missing SNAME macro optimization for StringName in some functions 2021-08-20 14:50:24 +02:00
PouleyKetchoupp
0b4037fe64 Fix logic for Popup closing when parent is focused
The member popped_up is used to avoid closing a Popup before it had a
chance to be focused. It wasn't reset properly when the popup is hidden,
causing the Popup to close right after showing in some random cases
(spotted on X11, might not happen on Windows).
2021-07-21 12:03:03 -07:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde
94875f5f48
Merge pull request #41851 from EricEzaM/PR/popup-menu-hysteresis
Added hysteresis for popup sub-menus
2020-11-16 09:34:28 +01:00
Eric M
c482e8ec85 Added hysteresis for popup sub-menus
This adds a small lag effect when opening submenus which allow the user to move directly to an item on the submenu without worrying about avoiding the autohide regions.
2020-11-08 13:28:23 +10:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Duroxxigar
b687ace7f9 Renamed toplevel to be top_level 2020-10-01 03:17:33 -04:00
Rémi Verschelde
2a8531cc56
Merge pull request #41456 from nekomatata/x11-fix-popups
Popup fixes for X11 display server
2020-09-03 00:09:19 +02:00
EricEzaM
73c7fb2118 PopupMenu rework and enhancements
Many scrolling behaviour improvements and the ability to limit popup size.
2020-09-01 17:56:38 +10:00
PouleyKetchoupp
6d1ef8efac Fix popup closed when an ancestor window is focused
Previously, only the direct parent were taken into account.

Popups like contextual menus could stay open if an ancestor which is
not a direct parent was focused.

Reproduction steps (any platform):
- Select a node in the scene tree
- Left click the node to start renaming
- Right click to open the copy/paste contextual menu
- Left click in the scene tree to deselect the node

Also closing popup when focusing out of the application, without waiting
for the parent to get focus to do so.
2020-08-22 18:42:42 +02:00
Rémi Verschelde
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde
07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Juan Linietsky
047e0b7de5 Reworked tooltips to use the popup system. 2020-03-26 15:49:45 +01:00
Juan Linietsky
b3080bc2f4 Popups have also been converted to windows
Controls using the old modal API have been replaced to use popups.
2020-03-26 15:49:44 +01:00
Juan Linietsky
441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
Juan Linietsky
4758057f20 Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rémi Verschelde
1dae4c9e7f
Merge pull request #31267 from sparkart/fix_optionbutton_offset
Fix Offset with OptionButton Popup
2019-08-14 11:43:42 +02:00
Fabian
97167209cb Exposed set_as_minsize to gdscript 2019-08-14 16:09:55 +09:30
Emmanuel Barroga
b97e198bdd Fix Offset with OptionButton Popup
Fixes the offset issue with the OptionButton's popup.
2019-08-12 00:13:02 -07:00
Hugo Locurcio
ff7184c5cb
Improve the node configuration warning display
- Refer to properties explicitly when possible
- When multiple warnings are returned, always separate them by one
  blank line to make them easier to distinguish
- Improve grammar and formatting
2019-07-09 00:18:00 +02:00
Bojidar Marinov
e222615e97
Fix editor remaining dimmed after certain actions
Fixes #30368
2019-07-06 17:37:40 +03:00
Guilherme Felipe
54653565a4 Fix Popup::popup_centered not centering at the first call 2019-06-25 12:04:29 -03:00
Rémi Verschelde
47f00925dc
Merge pull request #28454 from homer666/popup-centered-maxsize
Add `popup_centered_clamped()` method to Popup
2019-05-28 11:36:41 +02:00
homer666
80e9e93e27 Add Popup::popup_centered_clamped method
- Also replace redundant duplicate code in editor dialogs with calls to popup_centered_clamped()
2019-04-30 05:35:43 +10:00
Michael Alexsander Silva Dias
b8e09f98c4 Make buttons that trigger popups have the same scale 2019-04-29 13:07:47 -03:00
Naoto Kondo
f48829d1a4 Fix button alignment of Package Installer on OSX
This problem occurs only in the HiDPI environment.
2019-02-13 23:52:14 +09:00
Juan Linietsky
ed9b230744 Hide visible popups by default if visible when entering tree, unless on editor. Fixes #24737 2019-01-14 13:16:19 -03:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Juan Linietsky
6ce9951d9e Many fixes to gradient editor, which was pretty broken. Closes #19308 2018-09-07 13:49:10 -03:00
Guilherme Felipe
7a3882723c Fix #16069, #19292, #19267 and #18940 2018-06-06 13:16:52 -03:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Gilles Roudiere
6f185cc9f7 Remove unecessary anchors&margins set causing bad display (sons of containers) 2017-09-27 00:38:28 +02:00
Gilles Roudiere
05bb8e0c10 Remove set_area_as_parent_rect and replace it by set_anchors_and_margins_preset(PRESET_WIDE) 2017-09-22 11:39:44 +02:00
Rémi Verschelde
7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde
bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Hein-Pieter van Braam
cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Juan Linietsky
2cc8309249 Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
2017-08-21 19:56:08 -03:00
Ignacio Etcheverry
32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Juan Linietsky
541fdffc0a Merge pull request #10319 from neikeq/pr-engine-editor-hint
Adds Engine::is_editor_hint() method
2017-08-20 12:55:46 -03:00
Gilles Roudiere
06256cd778 Some control fixes and removed useless lines 2017-08-19 19:10:00 +02:00
Ignacio Etcheverry
90b8a5b71e Removes editor_hint from SceneTree 2017-08-19 01:29:45 +02:00
TwistedTwigleg
00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Gilles Roudiere
0d35d4d53b Replace GUI anchor type by a float between 0 and 1 2017-08-13 21:20:13 +02:00