Commit graph

361 commits

Author SHA1 Message Date
kobewi
36141dc469 Fix get_drag_data not overridable in some Controls 2023-03-20 21:42:13 +01:00
bruvzg
3ca3ee36ab
Fix IME position in the single window mode sub-windows. 2023-03-06 10:08:55 +02:00
Rémi Verschelde
008cafc103
Merge pull request #72378 from maximkulkin/line-edit-consume-events
Fix LineEdit not consuming events
2023-02-10 15:08:28 +01:00
Maxim Kulkin
5adc7e397e Fix LineEdit not consuming events
The most important issue is LineEdit not consuming
"ui_text_submit" event which makes pressing Enter after
editing escape to other components causing unwanted
interactions.

Also fix handling mouse button interactions not consuming
some events.

Also implement early return in case we know which event
type it is and there is no point in checking other event
types.

PS I'm also suspicious that mouse motion events also need
to be consumed, but haven't explored those cases.
2023-02-03 14:38:12 -05:00
Marcus Brummer
a54cb5b07b Always show caret when moving in LineEdit 2023-01-31 20:56:06 +01:00
Danil Alexeev
af8bf6f1d0
Fix LineEdit and TextEdit context menus not customizable 2023-01-27 11:14:54 +03:00
bruvzg
e08a6e692d
[Windows] Fix committing IME text without IME deactivation. 2023-01-26 09:24:12 +02:00
bruvzg
daad4aed62
Cleanup and unify keyboard input.
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes.
- Unify IME behaviour, add inline composition string display on Windows and X11.
- Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events.
- Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS.
- Add support for media key handling on macOS.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-01-23 15:08:12 +02:00
Rémi Verschelde
5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +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
Lucas Laukka
4e63395a78 fixed bug showing only two digits in color picker 2022-12-07 13:55:51 +01:00
Rémi Verschelde
45c6950f1b
Merge pull request #67123 from Rindbee/improve-caret-draw-conditions-for-LineEdit
Improve caret drawing conditions for `LineEdit`
2022-12-05 18:06:50 +01:00
bruvzg
c624b1eeac
[Line Edit] Ignore placeholder text when drawing caret. 2022-11-08 15:15:13 +02:00
Haoyu Qiu
3aed3edc06 Allow selecting SpinBox & LineEdit text when focus enters 2022-10-29 09:58:42 +08:00
bruvzg
4b1937c73f Abort LineEdit shaping if no font is set to avoid unnecessary error messages. 2022-10-14 12:57:42 +03:00
Rindbee
3f20108703 Improve caret drawing conditions for LineEdit
Now, `caret_can_draw` will be validated when a condition that affects
the drawability of the `LineEdit`'s caret changes; `draw_caret` will
be toggled when the caret's visibility is toggled due to blink, and
`draw_caret` will be `false` when `caret_blink_enabled` is disabled.

Fix toggling `caret_blink_enabled` could cause caret to no longer be
displayed.
Fix opening the context menu causing caret to no longer appear.
2022-10-09 22:14:40 +08:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
bruvzg
a750ca7ec1
Add split caret direction markers. Fix block/overtype caret size. 2022-10-07 08:45:52 +03: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
Micky
6dbd283ae5 Rename every instance of caret_blink_speed to caret_blink_interval
It's been changed in EditorSettings, LineEdit, TextEdit.

Affects setters and getters, and passed parameters, too.
2022-09-06 18:37:17 +02:00
Yuri Sizov
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +03:00
Micky
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
Rémi Verschelde
fed1189099
Merge pull request #62771 from bruvzg/line_edit_trim 2022-08-26 11:43:28 +02:00
风青山
e561c68256 Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
2022-08-23 23:25:22 +08:00
Yuri Sizov
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
Brian Semrau
103c0fa6e6 Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
bruvzg
3316454379
Fix LineEdit text incorrectly trimmed due to rounding errors. 2022-07-10 23:39:34 +03:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
Nolkaloid
9dc58511c6 Change LineEdit caret blink to use process
Now using internal process for blinking instead of a Timer node
2022-07-05 00:02:44 +02:00
iwek
082cf5440e Fix setting line edit caret after dobule and triple click 2022-06-10 00:18:25 +02:00
Michael Alexsander
71c8fb26e0 Take into account the clear icon's size even when not visible in LineEdits 2022-06-05 15:13:19 -03:00
Haoyu Qiu
e021fc9419 Fix LineEdit clear button for asymmetric stylebox 2022-05-28 19:50:35 +08:00
bruvzg
081b6b8053
Add ALT NUM+ {hex code} character input support for LineEdit, TextEdit and CodeEdit. 2022-05-13 09:33:24 +03:00
bruvzg
be611c1c05
Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +03: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
bruvzg
f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
kobewi
2057ea2883 Remove duplicate editor settings definitions 2022-03-06 22:05:49 +01:00
Hugo Locurcio
a06f82ca4d
Add optional constructor arguments to more Control nodes
This can be used to make editor code more compact.
However, as of writing, these constructor arguments cannot be used
from the scripting API.

This was already provided for Label and CheckBox, but it was missing
for other Control nodes where it made sense to provide a default value.
2022-03-04 09:48:41 +01:00
Hugo Locurcio
816d332e51
Fix LineEdit and TextEdit carets disappearing at theme scales below 1.0
This fixes carets disappearing in the editor when the Editor Scale
setting is set below 100%.
2022-03-03 00:15:48 +01:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
bruvzg
29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
Paulb23
1cd1df5dc3 Move placeholder color to theme item 2022-01-30 17:56:23 +00:00
bruvzg
40c56ed410
Improve locale detection.
Use separate language, script and country lists.
Add locale selection dialog and property hint.
2022-01-18 14:30:00 +02:00
Rémi Verschelde
f6792eacf5
Merge pull request #54956 from Calinou/lineedit-textedit-add-caret-width-theme-item
Add a theme constant to change LineEdit and TextEdit's caret width
2022-01-13 09:21:01 +01:00
bruvzg
c89c515ccf
[TextServer] Improve ligature cursor handling.
Fix mid-grapheme hit test.
Fix OpenType features property handling, add default features override option.
Enable mid-grapheme cursor by default.
2022-01-09 19:03:48 +02:00
Hugo Locurcio
f6443beade
Add a theme constant to change LineEdit and TextEdit's caret width
This can be useful to improve caret visibility, especially at
larger font sizes. This can also be used for accessibility purposes.
2022-01-07 20:51:22 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00