Commit graph

2520 commits

Author SHA1 Message Date
Daniel Ting 6f71bc2a06 Evenly distribute stretched Nodes in BoxContainer
Add any leftover fractional pixels to an error accumulator. When the
accumulator is greater or equal to one, add one pixel to the current
Node's size and subtract one from the accumulator.

Closes #36522

(cherry picked from commit 04ea6ec88d)
2020-07-28 00:39:21 +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
Tomasz Chabora e511e0f16a Prevent infinite loop in Tree incremental search
(cherry picked from commit c0479496fa)
2020-07-24 10:31:57 +02:00
Umang Kalra dc7e9d46e6 Fixes the get_visible_line_count() of rich text label
(cherry picked from commit bd32c273ff)
2020-07-24 10:31:56 +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
Maganty Rushyendra e76a9a51df Emit signals for GraphEdit multi-node selection and unselection
Emit `node_selected` and `node_deselected` signals where appropriate
when selecting or unselecting multiple GraphEdit nodes at once.

(cherry picked from commit c1d5c7727c)
2020-07-13 15:12:50 +02:00
lrgilbert c0db0749f7 Fixed separation of ports on GraphNode
Fixes #32474.

(cherry picked from commit 47c929c972)
2020-07-03 15:34:30 +02:00
PouleyKetchoupp d6b23306c8 Fix RichTextLabel fill alignment regression
Fixes #40068 (regression from #39164) by not applying the line offset
change in the case of fill alignment mode.

(cherry picked from commit 44f88999c7)
2020-07-03 15:34:30 +02:00
Michael Alexsander 32c154d297 Fix Tree's 'scroll_to_item()' not working correctly on some cases
(cherry picked from commit 144a4cc39f)
2020-07-03 13:17:57 +02:00
Mark Kuo 46590fa3b0 VideoPlayer: fix possible race condition
In set_stream() we write to 'playback' while accessing the same object
in _mix_audio() in audio thread. Protect the 'write' part in
set_stream() to avoid possible crash in _mix_audio() function.

(cherry picked from commit e435d57758)
2020-07-03 13:17:57 +02:00
Haoyu Qiu 38509f1a89 Prevent dragging from SceneTree buttons
(cherry picked from commit 45d0799b5b)
2020-07-03 13:17:57 +02:00
Stijn Hinlopen 65155c2855 No longer scroll vertically when scrollbars are unavailable
(cherry picked from commit 5f7499beac)
2020-06-29 10:47:43 +02:00
Pedro J. Estébanez 0f0360702b Handle gone TabContainer popup nicely 2020-06-24 19:31:26 +02:00
PouleyKetchoupp b3af0b2a39 Option in RichTextLabel for height to fit content
(cherry picked from commit ad8081216c)
2020-06-19 16:17:27 +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
Umang Kalra 1d0c39e395 Fixes the stopping of animation effects in bbcode after appending
(cherry picked from commit 88b30a29bf)
2020-06-15 14:34:35 +02:00
Lisandro Lorea cb119e349a Fix TabContainer emitting spurious tab_selected signals when a theme is changed
- The repaint code was moved outside of set_current_tab() and to a "_repaint()" private function
- _on_theme_changed() will now only call _repaint() and update()
This means _on_theme_changed() will do only what it needs (repainting the TabContainer to account for the new theme)

fixes #39498

(cherry picked from commit 5123006f06)
2020-06-15 14:34:35 +02:00
Tomasz Chabora 2f04896b0e Re-enable scroll follow on RichTextLabel clear
(cherry picked from commit 46fd51056a)
2020-06-15 14:34:35 +02:00
Thibault Truffert 24b3bf0637 Make text deletion methods public for LineEdit
(cherry picked from commit 2bb44ea5bd)
2020-06-11 09:42:23 +02:00
Rémi Verschelde 7bf9787921 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.

(cherry picked from commit cd4e46ee65)
2020-06-10 15:30:52 +02:00
Michael Alexsander 2652a2d184 Add generic file icon and its modulation to the 'FileDialog'
(cherry picked from commit 637927f803)
2020-06-10 15:30:52 +02:00
Giuliano Barberi 221051d523 Tree: Calling update in _gui_input less frequently
(cherry picked from commit d443a13244)
2020-06-10 15:30:51 +02:00
Umang Kalra c1f6854ada Fixes the right and center alignment bug of rich text label
(cherry picked from commit b2a32d007d)
2020-06-04 12:09:40 +02:00
Dominik 'dreamsComeTrue' Jasiński d15e9c2126 Allow scroll_to_line when scroll_active is 'false'
Fix #36134

(cherry picked from commit 8f11a91917)
2020-06-04 12:09:39 +02:00
Thakee Nathees 25ed0d4366 colorpicker margin bug fixed
(cherry picked from commit 9d224ac429)
2020-06-04 11:14:16 +02:00
SkyJJ 2197ef0566 Fix Android LineEdit editing bugs
(cherry picked from commit cc473b948f)
2020-05-20 12:07:08 +02:00
Marcus Brummer 4779d289d5 Fixed text editor drawing if smooth scrolling is disabled.
Fixes #38778

(cherry picked from commit b048eb05ad)
2020-05-18 16:40:33 +02:00
smartin015 8cab02ec06 Remove get_local_mouse_position() hack in GraphEdit
(cherry picked from commit 00457c68bc)
2020-05-18 16:40:33 +02:00
etienne.frank 46327d48a2 Fix minimap selection offset
The minimap selection was shifted of 1 line too late.

(cherry picked from commit 72ab355945)
2020-05-13 16:10:12 +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
janglee d16abbdee4 Improved go-to definition (Ctrl + Click)
Co-Authored-By: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
(cherry picked from commit be7a353c70)
2020-05-11 09:33:21 +05:30
Thakee Nathees 1a39b4ea22 method bind TextEdit::set_line() added
(cherry picked from commit b9acf1cedf)
2020-05-07 13:43:43 +02:00
nobuyuki_nyuu 12386a2d80 PopupMenu.get_current_index() bound to ClassDB
(cherry picked from commit 35f30086de)
2020-05-07 13:36:53 +02:00
Stanislav Labzyuk e3712cf689 Bind set_suffix/get_suffix in Tree
(cherry picked from commit ac8814624d)
2020-05-06 23:31:02 +02:00
Eric M b7fbdf4bed Updated editor spin slider to have better behaviour and adjusted control's size_flags_stretch_ratio value range
(cherry picked from commit 915ab50673)
2020-05-06 23:30:28 +02:00
Darenn 3c26de316e Fixed bbcode parsing for built-in RichTextEffects in RichTextLabel
RichTextEffect can now have a bbcode string starting like one of the built-in.
It was impossible before as the built-in would take precedence over the custom effect that has the same bbcode start.

Example : [fade] would take precedence over [fade_in]
(cherry picked from commit b4e3042cba)
2020-05-01 10:57:00 +02:00
John Wigg ee8b3bef2d Limit undo stack size
The stack size of the undo history of a TextEdit was not limited leading
to potential memory leaks when doing lots of operations on a TextEdit.

This commit adds the option gui/common/text_edit_undo_stack_max_size
to the project settings. The first element of the undo stack is popped
if the stack's size exceeds this value ensuring limited memory usage.

The default stack size setting is 1024.

Fixes #37838.

(cherry picked from commit 4a82390aaf)
2020-05-01 10:56:58 +02:00
Pedro J. Estébanez 07c4dc1b30 Avoid invocation to Object's copy constructor
Needed for the next commit. That's the only place in all the Godot code base
where that's attempted and it's not needed because Objects are not meant to
be copied that way.
2020-04-23 12:44:47 +02:00
asheraryam 93f7e8d8fc Add "node_unselected" signal for GraphEdit 2020-04-16 16:56:58 +03:00
Michael Alexsander b4429c325a Fix incorrect TabContainer documentation for 'get_tab_control()'
(cherry picked from commit 8f925b1970)
2020-04-16 12:57:22 +02:00
Dominik 'dreamsComeTrue' Jasiński 5fdecebee1 Calculate strike-through position correctly
Fixes: #37637
(cherry picked from commit 06a79f260c)
2020-04-16 12:57:22 +02:00
theludovyc 58fcbc2b06 Remove unused ofs variable
(cherry picked from commit 875c994109)
2020-04-16 12:47:18 +02:00
Guilherme Felipe ddde3819d6 Fix TextureRect::flip_* when used with atlas texture
Fix #37526

(cherry picked from commit fb2d2dd5d0)
2020-04-16 12:47:18 +02:00
PouleyKetchoupp 18c5ef5473 Add style for highlighted Slider grab area
(cherry picked from commit 4c8173af0f)
2020-04-16 12:47:17 +02:00
Leleat 8da00fbfc7 fixed PopupMenus letterjumping on any InputEvent
(cherry picked from commit 8a5660f3d1)
2020-04-16 11:58:14 +02:00
Zak Grumbles 5d9108c9c6 Fix OptionButton docs godotengine#36803
* item_selected and item_focused docs incorrectly had 'id' as the parameter. Changed to
'index'.
* Fix parameter name in ADD_SIGNAL callin code.

(cherry picked from commit a8de034f78)
2020-04-16 11:45:19 +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
janglee e1ca49b4b6 Corrected text selection in color picker
Fixes #35603

(cherry picked from commit 77b70aa79d)
2020-04-16 11:43:35 +02:00
qarmin 57952d562c Fixes leak with drives [3.2] 2020-04-12 14:05:47 +02:00