Commit graph

234 commits

Author SHA1 Message Date
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
Rémi Verschelde
0a8c5845e3
Merge pull request #41870 from nekomatata/fix-line-edit-enter-regression
Fix LineEdit not consuming enter events
2020-09-08 11:14:33 +02:00
PouleyKetchoupp
5c63dec36e Fix LineEdit not consuming enter events
LineEdit should not return early when processing KEY_ENTER, so it can
consume the event properly.

Regression introduced by mistake while fixing enter events for Android
(PR #40487 - c0b394572f)
2020-09-08 10:22:37 +02:00
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Rémi Verschelde
7844775a76
Revert "Updated LineEdit to address #41278"
This reverts commit 71febfd6e2.
2020-09-01 14:04:37 +02:00
Tony-Goat
71febfd6e2 Updated LineEdit to address #41278
Updated set_max_length() function to actually pull a substring of the current text so it's not all thrown away when the new max length is shorter than the current length.
2020-08-26 11:19:24 -06:00
Rémi Verschelde
044b3d0ed3
Merge pull request #37769 from HellonLegs/master
solved ctrl + alt + special character Issue #6851
2020-08-14 13:03:07 +02:00
PouleyKetchoupp
8c05dadcff Fix Return key events in LineEdit & TextEdit on Android
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.

Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.

Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.

Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
2020-07-26 20:06:07 +02:00
Rémi Verschelde
a30bac94cc
Merge pull request #39737 from Cevantime/add_force_caret_displayed_to_line_edit
add force caret display to line edit
2020-07-23 18:02:51 +02:00
PouleyKetchoupp
0aa56e3ab8 Add option to disable virtual keyboard for LineEdit
Co-authored-by: Alexander Holland <alexander.holland@live.de>
2020-07-22 08:19:05 +02:00
Cevantime
dc46bc8857 add force caret display to line edit 2020-07-15 13:00:25 +02:00
Juan Linietsky
f0e320decf Fix some popups menu missing screen transform.
Closes #38591
2020-07-01 14:44:19 -03:00
Juan Linietsky
438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
Andy Maloney
7433c9d40c [macOS] Command-backspace in line edit
Make command-backspace in line edit work like other macOS applications.

If there is a selection, command-backspace deletes the selection.

If there isn't a selection, command-backspace deletes from the cursor to the beginning of the line edit.

This addresses part of godotengine/godot#23548
2020-06-18 17:45:40 -04:00
Thibault Truffert
2bb44ea5bd Make text deletion methods public for LineEdit 2020-06-10 22:16:48 +02:00
SkyJJ
cc473b948f Fix Android LineEdit editing bugs 2020-05-16 17:55:27 +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
Eduardo Nunes Pereira
d8f8a3c606 Using the common behaviour when use command+shift on text line for osx
* On press left+command+shift or right+command+shift it should behave like shift+home or shift+end and select the text
* Using home and end events as reference
2020-05-11 10:25:07 +02:00
Rémi Verschelde
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
HellonLegs
f412237f38 solved control + alt issue 2020-04-10 19:49:51 +02:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Juan Linietsky
a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
bruvzg
15a9f94346 Add macOS DisplayServer implementation.
Change global menu to use Callable, add support for check items and submenus.
2020-03-26 16:24:05 +01:00
Juan Linietsky
441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
Juan Linietsky
8e6960a69e Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26 15:49:39 +01:00
Juan Linietsky
9e08742de8 Added a Window node, and made it the scene root.
Still a lot of work to do.
2020-03-26 15:49:38 +01:00
Juan Linietsky
f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
Rémi Verschelde
4d7ab010db
Merge pull request #37281 from ThakeeNathees/fix-project-manager-don't-consume-Enter
Fix: project manager don't consume Enter key #17620
2020-03-25 08:13:04 +01:00
Thakee Nathees
b98153886f fix project manager don't consume Enter key #17620 2020-03-25 07:09:36 +05:30
Darren Kaste
c7c47410aa Use LineEdit secret character width everywhere 2020-03-19 19:06:14 -04:00
Rémi Verschelde
cf50ee4fa4
Merge pull request #37094 from dkaste/line-edit-secret-select
Calculate LineEdit selection with secret character
2020-03-18 21:50:14 +01:00
simpuid
43b2f75d64 Remove update condition from LineEdit::update_placeholder_width
Placeholder with length greater than `max_length` are allowed, so there is no reason for those update condition.
It fixes the odd alignment of placeholder when it's length is greater than `max_length`
2020-03-18 02:22:45 +05:30
Darren Kaste
395a038c85 Calculate LineEdit selection with secret character 2020-03-16 12:22:13 -04:00
Rémi Verschelde
e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Rémi Verschelde
01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Rémi Verschelde
d94155e10b
Merge pull request #36050 from eswartz/line-edit-move-cursor-on-unselect
Use left/right arrow to move cursor when unselecting in LineEdit
2020-02-27 14:04:19 +01:00
Juan Linietsky
33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
bruvzg
1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Rémi Verschelde
2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
Juan Linietsky
69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Ed Swartz
ee39093ce3 Use left/right arrow to move cursor when unselecting in LineEdit
-- useful for rename dialog (the filename portion is selected by
default, and usually, want to change the end of the name, not the
beginning)
2020-02-15 09:24:20 -06:00
Juan Linietsky
3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Rémi Verschelde
7f95e027b4
Merge pull request #35814 from timothyqiu/line-edit-shortcut
Adds CTRL-A CTRL-E support to LineEdit on macOS
2020-02-09 12:51:59 +01:00
sumit0190
2e08578985 Update cached_width of the line_edit element when setting it to be secret 2020-02-08 10:49:08 -05:00
Haoyu Qiu
4774043f8e Adds CTRL-A CTRL-E support to LineEdit on macOS 2020-02-01 13:35:16 +08:00
Bruno Lourenço
a3bcdbeb78 Android virtual keyboard respecting LineEdit max length. 2020-01-23 01:52:49 +00:00
Haoyu Qiu
26e3b4a58a Updates LineEdit's min size when necessary
These properties will affect the minimum size of LineEdit:

* The right icon (`set_right_icon`)
* The clear button (`set_editable` and `set_clear_button_enabled`)
* The text, when "expand to text length" is enabled (`set_text`)
2020-01-15 10:15:32 +08:00
Paulb23
22c15083af Fix empty LineEdit crash on ctrl+backspace 2020-01-11 17:57:36 +00:00