Commit graph

851 commits

Author SHA1 Message Date
Haoyu Qiu
eac9adf7a1 Don't allow removing TextEdit's main caret 2022-10-10 08:30:23 +08:00
microaeris
215fe852b8 Getters for TextEdit scrollbars 2022-10-07 23:16:04 -07: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
Paulb23
4a9d4e3dad Add mutliple Caret support to TextEdit 2022-10-05 17:19:26 +01:00
Paulb23
7dd3857f7e Move selecion into caret 2022-10-03 14:09:27 +01:00
bruvzg
3278917c7a
[TextEdit] Use error/selection font color for the current glyph only, instead of updating cached font color. 2022-09-23 11:25:39 +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
Rémi Verschelde
33b4153764
Merge pull request #64917 from Tim-Fronsee/fix/add-gutter-total-width 2022-09-02 20:52:11 +02:00
Tim Fronsee
e5c183b01e Fix TextEdit::gutters_width (total gutter width) when adding & removing a gutter by calling TextEdit::_update_gutter_width in TextEdit::add_gutter & TextEdit::remove_gutter
Update TextEdit gutters subcase, gutter add and remove to ensure gutter total width is correct

Fix test_code_edit symbol lookup test case to include padding (+2)
2022-08-31 10:01:40 +09: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
风青山
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
1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +03:00
Brian Semrau
103c0fa6e6 Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
bruvzg
36ef8f29dc
Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
kobewi
f4a7450216 Fix too thin underline in brace match 2022-07-10 18:23:03 +02:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
kobewi
41f6e7c50e Allow to disable TextEdit vertical scroll 2022-07-04 15:02:15 +02:00
ConteZero
5d56efcaa4 Add an option to drag'n'drop selected text in TextEdit 2022-06-26 15:22:02 +02:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
iwek
848e759d88 Remove redundant min call when setting line 2022-06-02 15:52:09 +02:00
Rémi Verschelde
9923851370 Fix typos with codespell
Using codespell 2.2-dev from current git.
2022-05-23 21:32:19 +02:00
Rémi Verschelde
c0d189fbb8
Merge pull request #60955 from pfertyk/issue-60668-fix-get-breakpointed-lines-crash
Fix `get_breakpointed_lines` crashing Godot
2022-05-18 22:55:30 +02:00
Paweł Fertyk
3d5dd91f22 Fix get_breakpointed_lines crashing Godot
Fixes #60668.
2022-05-16 18:46:01 +02:00
bruvzg
081b6b8053
Add ALT NUM+ {hex code} character input support for LineEdit, TextEdit and CodeEdit. 2022-05-13 09:33:24 +03:00
Paweł Fertyk
d1aed90976 Fix backspace when selection reaches left edge
Fixes #60866.
2022-05-09 14:16:28 +02:00
Rémi Verschelde
8c2b9801fd
Merge pull request #60438 from Paulb23/text-edit-tests
Add TextEdit unit tests and multiple fixes.
2022-04-25 23:39:30 +02:00
Paulb23
7f62a74927 Multiple small TextEdit Bug Fixes
Fixed line_drawing_cache not containing anything
Fixed is_move_caret_on_right_click_enabled requiring the context menu to be enabled
Fixed when selecting_enabled is false not disabling shift + click
Fixed when selecting_enabled is false not being able to drag the caret
Fixed _delete emitting signals when nothing had changed.
Fixed insert_line_at up causing a visual update
Fixed get_pos_at_line_column returning a valid position when it was invalid
Fixed set_caret_column unnecessary emitting "caret_changed" when the column is greater then the line
Fixed select_word_under_caret not accepting the edges of words
Fixed select_word_under_caret moving the caret to the start of the line when no word was found
Fixed get_selection_line and get_selection_column not checking if the selection was enabled
Fixed set_line_as_center_visible throwing errors if it would show line 0
Fixed set_line_as_center_visible being off by one
Fixed set_line_as_last_visible not being able to show the first line
Fixed pressing UP and the end of a wrapped line sending the caret to col 0 rather then then persevering the position.
2022-04-22 17:53:14 +01: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
ConteZero
a3d82f5afb Fix shortcut_keys_enabled in TextEdit 2022-04-08 15:13:32 +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
8cefbfcf43 Consider chained operation when selecting text in TextEdit::undo() 2022-04-05 09:12:10 +08:00
Rémi Verschelde
f454cea785
Merge pull request #58452 from marcgpuig/text-edit-backspace-fix 2022-04-04 23:58:33 +02:00
Marc Garcia Puig
f22d257025 Fixed ctrl + backspace on empty lines
Fix <word><space><caret> scenario

Fix move left & right for lines without words
2022-04-04 01:21:16 +02:00
jmb462
0d17903bd5 Fix TextEdit v_scroll_speed invalid values breaks wheel scrolling 2022-04-03 21:07:39 +02:00
nova++
4b8fa3716f Fix "p_from_line > p_to_line" errors in text edit
Done via making the function more robust to different inputs
2022-03-11 01:13:45 -05:00
Rémi Verschelde
8845798b44
Merge pull request #58739 from Calinou/control-add-constructors
Add optional constructor arguments to more Control nodes
2022-03-04 11:42:53 +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
Haoyu Qiu
933211cb0c Remove extra separator when TextEdit is read only and unselectable 2022-03-04 16:25:25 +08: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
Paulb23
7f5782047e Fixed caret change signal emission 2022-02-28 19:01:44 +00: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
Rémi Verschelde
1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
bruvzg
244db37508
Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
bruvzg
215bede6ff
[TextServer] Add function to change font, font size, and OpenType features without invalidating line break points, justification points, or recreating shaped text buffer. 2022-02-02 11:20:44 +02:00
Paulb23
1cd1df5dc3 Move placeholder color to theme item 2022-01-30 17:56:23 +00:00
Paulb23
e911eee21b Fix TextEdit placeholder not checking line count 2022-01-25 17:41:05 +00:00