Commit graph

238 commits

Author SHA1 Message Date
Nong Van Tinh
ffbaa7fff0 Enhance null checking for input event 2022-11-27 15:01:34 +07:00
Rémi Verschelde
26762a71b6
Merge pull request #58537 from winterpixelgames/feature/virtual-keyboard-types-3.x 2022-08-05 19:37:13 +02:00
Brian Semrau
ce24b48e50 Add support for multiple virtual keyboard types 2022-07-07 14:22:28 -04:00
Haoyu Qiu
d86a2d57cf Fix LineEdit caret after using arrow key to deselect 2022-07-06 09:32:39 +08:00
Michael Alexsander
43b0e054be Take into account the clear icon's size even when not visible in LineEdits 2022-06-05 16:22:01 -03:00
Haoyu Qiu
1e6747d185 Fix LineEdit clear button for asymmetric stylebox 2022-05-28 19:51:50 +08:00
Haoyu Qiu
d088128b43 Remove duplicate editor settings definitions 2022-04-27 15:26:46 +08:00
Rémi Verschelde
8182a754d2
Merge pull request #59827 from ConteZero/fix_right_menu 2022-04-14 21:29:57 +02:00
Yuri Roubinsky
e54a4646c7 Add selection getter methods to LineEdit
Co-authored-by: Yuri Roubinsky <chaosus89@gmail.com>
2022-04-12 14:31:51 +02:00
ConteZero
57b616fb21 Fix Right-Click clearing selection 2022-04-03 10:18:12 +02:00
ConteZero
2ff0735329 Added primary clipboard for Linux 2022-03-14 15:28:36 +01:00
ConteZero
0ffacff998 [3.x] Add option to make selection unique 2022-03-14 09:48:09 +01:00
Rémi Verschelde
08c3e00b95
Merge pull request #55355 from ConteZero/drag_and_drop_3.x 2022-03-14 08:43:22 +01:00
ConteZero
4167e98088 Add drag and drop to TextEdit, LineEdit, RichTextLabel 2022-03-14 08:15:25 +01:00
lawnjelly
a0c6d16c90 Add editor vital redraws only option
When editor continuous redraws is switched off, the editor only redraws when a redraw_request was issued by an element in the scene. This works well in most situations, but when scenes have dynamic content they will continuously issue redraw_requests.

This can be fine on high power desktops but can be an annoyance on lower power machines.

This PR splits redraw requests into high and low priority requests, defaulting to high priority. Requests due to e.g. shaders using TIME are assigned low priority.

An extra editor setting is used to record the user preference and an extra option is added to the editor spinner menu, to allow the user to select between 3 modes:

* Continuous
* Update all changes
* Update vital changes
2022-02-02 11:26:45 +00:00
Haoyu Qiu
64fcf7ee77 Fix LineEdit center and right alignment 2022-01-16 20:39:11 +08:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Haoyu Qiu
eab1e228c8 Fix LineEdit undo crash
Make sure all related member variables are initialized before creating
the first undo state.
2021-09-29 13:52:40 +08:00
Ed Swartz
c79898a7b8 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)
2021-09-14 20:26:10 -05:00
Haoyu Qiu
5f316aa216 Improve Undo/Redo menu items
* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu  (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-18 00:46:51 +08:00
Rémi Verschelde
32f5bee985
LineEdit: Respect max_length by truncating text to append
When appending text (either via `set_text()` or by pasting from clipboard),
if the input would make the `LineEdit` exceed its configured `max_length`,
the input text is truncated to fit. The discard part is passed as a parameter
in the `text_change_rejected` signal.

Fixes #33321.
Fixes #41278.

Also cleaned up unimplemented `max_chars` property in `TextEdit`.

Co-authored-by: Tony-Goat <70238376+Tony-Goat@users.noreply.github.com>
(cherry picked from commit 9a1ce8e6c3)
2021-07-13 10:20:02 +02:00
kobewi
cb5870dd4a
Display arrow cursor if text is not editable
(cherry picked from commit c3967c80ab)
2021-05-09 17:50:06 +02:00
Rémi Verschelde
140350d767
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
2021-05-05 15:02:01 +02:00
Rémi Verschelde
a828398655
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2021-05-04 16:30:23 +02:00
Rémi Verschelde
b5e1e05ef2
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
Rémi Verschelde
3d15f04668
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2021-05-04 14:45:15 +02:00
Rémi Verschelde
d252ef4c5e
Merge pull request #46527 from kuruk-mm/3_2_lineedit 2021-04-29 13:32:33 +02:00
ray90514
ea8004052d
Fix LineEdit undo behaves strangely
(cherry picked from commit 7501c7f48a)
2021-04-26 12:20:28 +02:00
Mateo Kuruk Miccino
74b3021691 LineEdit: Now double click to select a word, and triple click to select all the content 2021-02-28 17:41:11 -03:00
kobewi
7ede2f36fe
Allow to override drop data in LineEdit
(cherry picked from commit a3a31591b5)
2021-01-26 17:24:55 +01:00
Sergey Minakov
7b8d6d2413 [GUI] Enforce virtual keyboard redisplay on clear 2021-01-26 13:18:14 +03:00
Rémi Verschelde
49646383f1
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 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
Rémi Verschelde
5c80c94449
Revert "solved ctrl + alt + special character Issue #6851"
(cherry picked from commit 8b7f582f22)
2021-01-05 21:33:33 +01:00
Tomasz Chabora
0c50509326
Update clear button when clicked
(cherry picked from commit 836b78f329)
2020-11-26 09:38:47 +01:00
PouleyKetchoupp
9b64646bc3
Expose LineEdit scroll offset to scripts
(cherry picked from commit 4775db1600)
2020-11-11 15:44:18 +01:00
HellonLegs
9340385731
LineEdit/TextEdit: solved control + alt issue
(cherry picked from commit f412237f38)
2020-09-24 14:43:08 +02:00
PouleyKetchoupp
c21d14fe69
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)

(cherry picked from commit 5c63dec36e)
2020-09-08 13:38:58 +02:00
Rémi Verschelde
8a66ea7cb0
Revert "Updated LineEdit to address #41278"
This reverts commit 1b6d116dfb.
2020-09-01 14:01:50 +02:00
Tony-Goat
1b6d116dfb
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.

(cherry picked from commit 71febfd6e2)
2020-08-31 15:53:56 +02:00
Rémi Verschelde
a2edf04fd2
Merge pull request #40469 from nekomatata/virtual-keyboard-enter-fixes-3.2
[3.2] Fix Return key events in LineEdit & TextEdit on Android
2020-07-26 20:26:02 +02:00
PouleyKetchoupp
930c880fa6 Add option to disable virtual keyboard for LineEdit
Co-authored-by: Alexander Holland <alexander.holland@live.de>
(cherry picked from commit 0aa56e3ab8)
2020-07-24 10:31:57 +02:00
PouleyKetchoupp
c0b394572f 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-17 18:25:40 +02:00
Andy Maloney
5bbb15418f [3.2][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:42:51 -04:00
Thibault Truffert
24b3bf0637 Make text deletion methods public for LineEdit
(cherry picked from commit 2bb44ea5bd)
2020-06-11 09:42:23 +02:00
SkyJJ
2197ef0566 Fix Android LineEdit editing bugs
(cherry picked from commit cc473b948f)
2020-05-20 12:07:08 +02:00
Eduardo Nunes Pereira
55ab98233a 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

(cherry picked from commit d8f8a3c606)
2020-05-11 11:13:22 +02:00
Thakee Nathees
324213a6db fix project manager don't consume Enter key #17620
(cherry picked from commit b98153886f)
2020-04-16 11:44:44 +02:00
simpuid
223d0abd7e 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`

(cherry picked from commit 43b2f75d64)
2020-03-25 11:38:53 +01:00
Darren Kaste
53c8d8a5fb Use LineEdit secret character width everywhere
(cherry picked from commit c7c47410aa)
2020-03-25 11:38:53 +01:00
Darren Kaste
f657614760 Calculate LineEdit selection with secret character
(cherry picked from commit 395a038c85)
2020-03-25 11:38:53 +01:00