godot/scene/gui
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
..
SCsub SCons: Format buildsystem files with psf/black 2020-06-10 15:30:52 +02:00
aspect_ratio_container.cpp doc: Sync classref with current source 2021-01-13 16:55:27 +01:00
aspect_ratio_container.h doc: Sync classref with current source 2021-01-13 16:55:27 +01:00
base_button.cpp Emit button_up signal after setting pressed to false. 2021-06-17 12:47:53 +02:00
base_button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
box_container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
box_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
button.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
center_container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
center_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
check_box.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
check_box.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
check_button.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
check_button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
color_picker.cpp Add cache to color picker for presets 2021-07-07 18:06:31 -04:00
color_picker.h Add cache to color picker for presets 2021-07-07 18:06:31 -04:00
color_rect.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
color_rect.h Update copyright statements to 2021 2021-01-13 16:17:06 +01:00
container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
control.cpp Allow to create a node at specific position 2021-07-07 13:19:59 +02:00
control.h Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
dialogs.cpp Add AcceptDialog::remove_button method 2021-07-06 18:27:03 +02:00
dialogs.h Add AcceptDialog::remove_button method 2021-07-06 18:27:03 +02:00
file_dialog.cpp FileDialog: Fix capitalization for overwrite prompt 2021-07-08 01:05:45 +02:00
file_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
gradient_edit.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
gradient_edit.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
graph_edit.cpp Allow higher and lower maximum zoom values in GraphEdit 2021-06-17 12:47:54 +02:00
graph_edit.h Move default values from definition to declaration in GraphEdit 2021-06-10 17:17:18 +01:00
graph_node.cpp Fix GraphNode port position when the control has the Expand flag 2021-06-29 14:02:23 +02:00
graph_node.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
grid_container.cpp Style: Cleanup uses of double spaces between words 2021-06-07 12:06:59 +02:00
grid_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
item_list.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
item_list.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
label.cpp Fix RichTextLabel auto-wrapping on CJK 2021-06-08 21:04:20 +08:00
label.h Style: Replaces uses of 0/NULL by nullptr (C++11) 2021-05-04 16:30:23 +02:00
line_edit.cpp LineEdit: Respect `max_length` by truncating text to append 2021-07-13 10:20:02 +02:00
line_edit.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
link_button.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
link_button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
margin_container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
margin_container.h Update copyright statements to 2021 2021-01-13 16:17:06 +01:00
menu_button.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
menu_button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
nine_patch_rect.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
nine_patch_rect.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
option_button.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
option_button.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
panel.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
panel.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
panel_container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
panel_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
popup.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
popup.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
popup_menu.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
popup_menu.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
progress_bar.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
progress_bar.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
range.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
range.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
reference_rect.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
reference_rect.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
rich_text_effect.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
rich_text_effect.h Update copyright statements to 2021 2021-01-13 16:17:06 +01:00
rich_text_label.cpp Merge pull request #49332 from megalobyte/doc-prev-search 2021-06-09 11:11:15 +02:00
rich_text_label.h Style: Replaces uses of 0/NULL by nullptr (C++11) 2021-05-04 16:30:23 +02:00
scroll_bar.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
scroll_bar.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
scroll_container.cpp ScrollContainer: Expose `_ensure_focused_visible` to the API 2021-05-31 19:05:30 -10:00
scroll_container.h ScrollContainer: Expose `_ensure_focused_visible` to the API 2021-05-31 19:05:30 -10:00
separator.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
separator.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
shortcut.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
shortcut.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
slider.cpp Fix vertical slider grabber_area height calculation 2021-06-14 15:46:09 -03:00
slider.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
spin_box.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
spin_box.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
split_container.cpp Make invisible `SplitContainer` nodes correctly calculate the minimal size of its children 2021-07-06 11:10:46 +02:00
split_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
tab_container.cpp Fixed bug in tab_container with hidden tabs 2021-05-09 17:47:38 +02:00
tab_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
tabs.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
tabs.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
text_edit.cpp LineEdit: Respect `max_length` by truncating text to append 2021-07-13 10:20:02 +02:00
text_edit.h LineEdit: Respect `max_length` by truncating text to append 2021-07-13 10:20:02 +02:00
texture_button.cpp TextureButton Update min size on any texture change 2021-06-17 12:47:54 +02:00
texture_button.h Added flip_h and flip_v properties in TextureButton 2021-06-01 12:52:14 +02:00
texture_progress.cpp Improve nine patch behavior of TextureProgressBar 2021-06-29 12:59:23 +02:00
texture_progress.h Improve nine patch behavior of TextureProgressBar 2021-06-29 12:59:23 +02:00
texture_rect.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
texture_rect.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
tool_button.cpp Update copyright statements to 2021 2021-01-13 16:17:06 +01:00
tool_button.h Update copyright statements to 2021 2021-01-13 16:17:06 +01:00
tree.cpp Avoid using a nullptr root in Tree._range_click_timeout(). 2021-07-13 09:47:07 +02:00
tree.h Style: Replaces uses of 0/NULL by nullptr (C++11) 2021-05-04 16:30:23 +02:00
video_player.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
video_player.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
viewport_container.cpp Style: Enforce braces around if blocks and loops 2021-05-05 15:02:01 +02:00
viewport_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00