Commit graph

1700 commits

Author SHA1 Message Date
Alexander Holland 6d684aae8a text_edit auto_completion
replaced "similarity filter" with "sequential checks" this give more control over the desired filtering.
2018-08-14 22:45:10 +02:00
Rémi Verschelde a3d0b89892
Merge pull request #20876 from ttencate/cursor_blink
Reset caret blink when Ctrl+moving the cursor
2018-08-14 15:42:19 +02:00
Rémi Verschelde 98da0df894
Merge pull request #20982 from hpvb/fix-19842
Emit pressed events after processing items
2018-08-14 09:37:54 +02:00
Hein-Pieter van Braam 868efb8184 Emit pressed events after processing items
When processing items we may actually delete the item we're processing
in the callback for the signal. To avoid this, call the signal after
we're done processing the items.

This fixes #19842
2018-08-13 21:55:26 +02:00
James 109028f52b Editor autocomplete: prefer same case candidates 2018-08-13 20:45:33 +02:00
Rémi Verschelde 68ab428d4d
Merge pull request #20155 from Tunous/line-edit-clear
Add clear button to search fields
2018-08-13 12:54:57 +02:00
Rémi Verschelde 9ce33978db
Merge pull request #20666 from Calinou/script-editor-underline-hidpi
Scale underlines in the script editor with the editor scale
2018-08-13 12:21:23 +02:00
Łukasz Rutkowski 81fb81de9d Do not use theme to set LineEdit right_icon 2018-08-11 12:04:26 +02:00
Łukasz Rutkowski e8a435c8cd Add clear text button to LineEdit
- Add pressed state to clear button
- Enable clear button on all inputs with search icon
- Remove duplicate clear buttons
- Fix rendering of icon for center and right alignments
- Add clear button to more search fields
- Add clear icon to default theme
- Add method to control enabled state of clear button
- Add property to enable clear button from inspector
2018-08-11 12:04:26 +02:00
Aaron Franke cf136a91d6 [Core] Completely kill math_2d.h, change includes 2018-08-11 03:08:34 -05:00
Chaosus aaf62fcecc Fix ReferenceRect border 2018-08-11 10:37:03 +03:00
Juan Linietsky 0fc1c4eda8
Merge pull request #20149 from Overblob/shader_float_typing
Shader language - Add optional float typings
2018-08-10 18:21:28 -03:00
Juan Linietsky b9730a6956 Make line edit always vertically aligned, makes no sense otherwise. Fixes #17188 2018-08-10 13:15:26 -03:00
Thomas ten Cate 44d761e55c Reset caret blink when Ctrl+moving the cursor
There was a hardcoded exception to never reset caret blinking if Ctrl
(`command`) was pressed. This broke on Ctrl+arrows,
Ctrl+Home/End/PgUp/PgDn, Ctrl+C, Ctrl+V, Ctrl+Backspace and Ctrl+Delete.

Resetting blink only for those Ctrl operations that actually touch the
cursor somehow would clutter the code a lot, so I removed the check
entirely. That means we now also reset blinking on unrelated operations
like Ctrl+O, but that seems pretty harmless. I actually like the
additional bit of feedback even in that case (most of these will
immediately defocus the editor anyway, so you never see it).

Fixes #18100
2018-08-10 11:23:13 +02:00
Hugo Locurcio 501fc98c63
Scale underlines in the script editor with the editor scale 2018-08-02 09:38:56 +02:00
Juan Linietsky c752c26427 Expose _clips_input as a virtual function, closes #15358 2018-07-29 12:48:17 -03:00
Juan Linietsky 0fcc28b6f3
Merge pull request #15269 from ianb96/context_menu_improvements
Context Menu Improvements
2018-07-29 12:31:20 -03:00
Rémi Verschelde 7056dc6011
Merge pull request #20498 from Calinou/caret-width-hidpi
Make the caret thicker in TextEdit and scale it with the editor scale
2018-07-27 09:01:58 +02:00
Hugo Locurcio f8a2cb3e15
Multiply TextEdit line spacing by the editor scale
This makes sure the default line spacing in the script editor
is consistent with the editor scale in use.
2018-07-26 23:50:16 +02:00
Hugo Locurcio 8d05f89bc1
Make the caret thicker in TextEdit and scale it with the editor scale
The caret in LineEdit is still 1 pixel thick, but it will become
2 pixels thick at editor scales higher than or equal to 150%.
2018-07-26 23:43:43 +02:00
Ian 1bb13e95a8 context menu improvements 2018-07-26 08:58:35 -04:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Rémi Verschelde f8e8ac2c66
Merge pull request #20133 from ibrahn/fix-tree-uninit-branch
fixed a branch on uninitialised data in gui/tree
2018-07-25 01:18:39 +02:00
Rémi Verschelde 3ecb25a283
Merge pull request #19726 from guilhermefelipecgs/feature_add_menu_hover
Opens the menu with the same parent on mouse focus
2018-07-25 01:05:37 +02:00
Guilherme Felipe d1f5deabd8 Opens the menu with the same parent on mouse focus 2018-07-24 19:59:40 -03:00
Juan Linietsky 2e67fc57e6
Merge pull request #18867 from fire/better_vx_us_rebase_02
Improve VisualScript UX
2018-07-24 18:02:10 -03:00
K. S. Ernest (iFire) Lee 85670726fd Improve VisualScript UX
* Prototype faster function call ux.
* Work on general search ux.
* Able to create nodes from search.
* Show class for variables but not methods.
* Get actions search working.
* Descriptions now show for both methods and properties.
* Enable zooming on mouse wheel up and down.
* Make the drag trigger on right mouse button.
* Search now shows for action visual script nodes.
* Able to search visual node names.
* Search works better.
* Change zooming scale to hide artifacts better.
* Remove zoom changes
* Select from base should check properties too like the other functions.
* Seq_connect flag is needed to set sequence lines correctly.
* Remove comment
* Code cleanup with function names and arguments.
* Use brief description for search descriptions.
* Clean and fix bug with input nodes connecting with sequence lines.
* Add a warning and fix some edge conditions with sequence into data lines and vice versa.
* Don't search functions when pulling from a sequence node.
* Don't show actions when pulling from a data line.
* Set set and get properties.
* Convert visual script operators to the correct type
* Create a function preset finds only functions.
* Singletons can now find functions.
* Add shift-a for generic search.
* Add brief descriptions for Visual Script nodes.
* Search boxes can now filter names.
* Add bigger hit zones to node connect.
* For the drop zones, make all the rect2 areas the same size.
* Function names in visual script node should be lower case so that search works better.
* Use the convention of capitalize() for set, set, visual script nodes and methods.
* Make search more general. Ignore "_" and make case-insensitive. Also made the search window smaller and remove extra info from search
* Make type_cast use the connecting node's type and remove use of found variable.
* Fix case where you call an instance's call function where it becomes an invalid call.
* Make get_visual_node_names use a set of filters, move action creations and fix bug with sequence node connections.
* Make the window bigger.
* Make connect_data and connect_seq more robust.
* Add icons to search items.
* Add vs constructors in shift-a menu.
* Operators, builtins and constructors show type name. Fix several problems with port connections.
* In shift-a mode search everything.
* Code cleanup
* Work on autocompleting the type.
  * Use type guess in action creation.
  * Check if type hint string exists in object variables when generating the visual script search.
  * Add the hint to SceneTree.
  * Add original type detection.
  * Make type casting great again. This puts the type casted base type as the data output type string hint.
  * Pass the type in a VisualScriptFunctionCall too.
  * Set the base type correctly in VisualScriptFunctionGet and VisualScriptFunctionSet using hint string.
  * Make sure the instance is passed in VisualScriptPropertySet.
  * Restore search on the node's type.
* Remove dependencies from graph_edit.
* Remove dependencies from property_selector and name the class visual_script_property_selector.
* Extract hot zones into a function.
* Move hot_zones constants into default theme.
* Bigger capture zones.
* Clean messy port_grab_distance variables.
* Remove RMB functionality.
* Remove memory leak on showing visual script descriptions.
* Read the port_grab_distance constants on enter tree and theme changed.
2018-07-24 13:59:28 -07:00
Rémi Verschelde fda6b78bae
Merge pull request #18806 from Calinou/bilinear-textureprogress
Add support for bilinear bars in TextureProgress
2018-07-24 22:31:24 +02:00
Wilson E. Alvarez a22e746bc3 Removed unnecessary assignments 2018-07-24 09:51:03 +02:00
George Marques 03746da73f
Add editor highlight for type-safe lines
The line number is hightlighted to indicate that the line contains only
type-safe code.
2018-07-20 21:55:18 -03:00
Juan Linietsky 336db8bcd1 -Fix tooltips in inspector, now they show as rich text. 2018-07-20 18:16:19 -03:00
Rémi Verschelde 13239cd4cc Export: Properly reload preset when opening dialog
Fixes #20119 where newly installed templates were not detected.

Also fix a bug with preset deletion where it would attempt to
edit an already removed preset. For this I made it so that
ItemList::deselect_all() also resets `current` to -1, as a manual
ItemList::deselect(idx) already does.
2018-07-18 13:49:34 +02:00
volzhs adb179154a Fix Label autowrap clips text 2018-07-18 02:19:05 +09:00
Max Hilbrunner adec9c3168
Merge pull request #20150 from ibrahn/fix-scrollbar-atlas
fix scrollbar icons with atlas texture.
2018-07-17 12:15:22 +02:00
Overblob e6ad5e23b4 * Small hex/float/integer parsing refactoring
* Potential bug fix on hex (cannot be used atm)
* Added optional typing for floats, eg:
"1f" -> "1.0"
"1.f" -> "1.0"
"1.99f" -> "1.99"
"1." -> "1.0"
2018-07-15 14:58:23 +02:00
Juan Linietsky f6ce73f724 Visual Shaders are back. 2018-07-14 18:16:18 -03:00
Ibrahn Sahir e51a94905d fix scrollbar icons with atlas texture.
Draw scrollbar icons through their textures, rather than calling
directly to the server. Allows atlas textures to manipulate the source
rect as required.
2018-07-14 14:02:08 +01:00
Ibrahn Sahir fb32adfcf8 fixed a branch on uninitialised data in gui/tree
I don't think it was really causing any harm, but this makes things a
little more explicit and helps clean up valgrind output.
2018-07-13 14:00:10 +01:00
Max Hilbrunner cc57b62ab3
Merge pull request #20068 from Xrayez/submenu-popup-delay
Add ability to set submenu's popup delay time on mouse hovering
2018-07-12 05:27:49 +02:00
Alexander Holland bf3c81f20b fix ColorPickerButton.get_popup() 2018-07-10 15:06:36 +02:00
Andrii Doroshenko (Xrayez) e3b77b24ac Add ability to set submenu's popup delay time on mouse hovering
This allows to set delay time for the submenu to popup. Setting
this value low can increase responsiveness. If the popup menu is added
as a child of another (acting as a submenu), it will inherit the delay
time of the parent menu item.
2018-07-09 18:37:41 +03:00
Chaosus dbd5afc498 Added scrollable property to Sliders 2018-07-07 13:48:34 +03:00
Max Hilbrunner c488a74e0c
Merge pull request #19498 from guilhermefelipecgs/fix_regression
Fix "find and replace" initializing with wrong size
2018-07-05 04:23:18 +02:00
Max Hilbrunner 16f1a77319
Merge pull request #19735 from Paulb23/text_offset_issue_15688
Fixed text drawing too high in TextEdit, issue 15688
2018-07-05 04:04:39 +02:00
Max Hilbrunner 43748f67be
Merge pull request #19351 from guilhermefelipecgs/fix_reversed_text
Fixes to the new inspector
2018-07-05 03:50:31 +02:00
Max Hilbrunner e3c8ac43c6
Merge pull request #19187 from Zirak/editor-autocomplete-quote
Editor autocomplete won't insert unnecessary quotes
2018-07-05 02:33:33 +02:00
Max Hilbrunner edc63a2f60
Merge pull request #18028 from gabrii/18026
Fix #18026. Expose TextEdit::set_draw_breakpoint_gutter.
2018-07-05 02:30:18 +02:00
Guilherme Felipe 709948aa5a Fixes to the new inspector
- Fix inspector dock not updating tree for main resource;
- Fixes the inspector input text reverted during typing;
- Add method bind for "refresh" used by MultiNodeEdit;
2018-07-04 20:08:45 -03:00
groud 560deda207 Fixes control nodes size not updated when outside the tree 2018-07-04 15:14:42 +02:00
Rémi Verschelde 3724f1562b
Merge pull request #19782 from Calinou/fix-control-pixel-snap-rounding
Fix control pixel snap rounding using floor() instead of round()
2018-07-04 15:11:08 +02:00
Max Hilbrunner fbff1804d2
Merge pull request #17438 from Deluvi/get-word-pos-quote-fix
get_word_at_pos considers simple and double quotes
2018-07-03 18:28:47 +02:00
Max Hilbrunner b21c1f64cd
Merge pull request #18634 from groud/fix_control_child_of_node2d
Fixes the bad calculation of margin & anchors when child of Node2D
2018-07-03 18:06:15 +02:00
Max Hilbrunner 24ce1ace13
Merge pull request #19244 from Chaosus/settingsperformance_and_colordeferred
Increases settings apply speed and added deferred color setting to ColorPicker
2018-07-03 17:01:23 +02:00
Max Hilbrunner 6efc1ba6e0
Merge pull request #19565 from robojumper/fixed_edge_scroll
Re-enable scrolling via selecting code beyond edges in text_edit.cpp
2018-07-03 16:11:19 +02:00
Juan Linietsky 2dc738ce27 -Fixes to how hashing happened, now StringName and NodePath use default hasher, this was leading to some severe slowdown in scenarios
-Fixes to some duplication scenarios for instanced scenes
2018-07-02 15:08:35 -03:00
George Marques d56d7299e4
Merge pull request #19875 from willnationsdev/meta-underlined
Fix underline_meta not working in RichTextLabel
2018-07-01 23:13:46 -03:00
Paulb23 8f390da422 Center text drawing in LineEdit 2018-07-01 15:46:33 +01:00
Guilherme Felipe b2e78e117c Fix performance for godot's interface 2018-07-01 09:48:03 -03:00
Will Nations a9ea06e73a Fix underline_meta not working in RichTextLabel 2018-07-01 00:15:27 -05:00
Juan Linietsky eeab3502d5 Changes to how node paths are selected from property, allowing setting a hint. 2018-06-27 20:50:25 -03:00
Hugo Locurcio 88c23e243f
Fix control pixel snap rounding using floor() instead of round()
This resulted in small leftwards/upwards movement of controls being
faster than it should be.

This closes #19763.
2018-06-26 17:55:23 +02:00
Paulb23 8a168637fe Fixed text drawing too high in TextEdit, issue 15688 2018-06-24 10:38:53 +01:00
Juan Linietsky 0a1c1c660f -Added AnimationGraphPlayer (still missing features)
-Added ability to edit resources from built-in inspector (wip, needs testing and feedback)
2018-06-18 22:12:08 -03:00
robojumper 4ba6755324 Re-enable scrolling via selecting code beyond edges in text_edit.cpp 2018-06-14 21:29:39 +02:00
Guilherme Felipe 5bae3693bf Fix "find and replace" initializing with wrong size
Fix the code editor outside the allowed limits.
2018-06-13 14:08:04 -03:00
Saracen 9d0bdf69c4 LineEdit IME position will now ignore placeholder text. 2018-06-13 16:42:36 +01:00
Rémi Verschelde d6d8237a5a
Merge pull request #19509 from SaracenOne/ime
IME context detection.
2018-06-13 15:26:50 +02:00
Guilherme Felipe b904c37a54 Fix TabContainer not showing tabs on left when resizing.
Fix #19510.
2018-06-12 15:59:53 -03:00
Saracen c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Max Hilbrunner e949230837
Merge pull request #18298 from gabrii/TextEditScaledSelection
TextEdit scaled selection
2018-06-09 19:35:48 +02:00
Juan Linietsky a8dd5750e2
Merge pull request #19334 from guilhermefelipecgs/fix_popup
Fixes popup_centered_* methods, dialogs with wrong sizes and visual script editor
2018-06-08 13:00:53 -03:00
groud 4d78e16bc1 Fixes the bad calculation of margin & anchors when child of Node2D 2018-06-07 21:25:15 +02:00
Juan Linietsky b659fd6d74 Entirely new (and much improved) animation editor. 2018-06-07 12:52:00 -03:00
Guilherme Felipe 7a3882723c Fix #16069, #19292, #19267 and #18940 2018-06-06 13:16:52 -03:00
Alexander Holland e3fcb7b011 expose lineedit 2018-06-06 01:19:27 +02:00
Chaosus cf38270ef7 Increase settings apply speed and added deferred color apply 2018-05-31 11:33:36 +03:00
Gabriel Gavilan b7b63fe034 Improve breakpoints and breakpoint gutter API in TextEdit
Added breakpoint_gutter, is_breakpoint_gutter_enabled, set_breakpoint_gutter_enabled, get_breakpoints, remove_breakpoints.
Fixed breakpoint_toggled signal not fierd when text is edited.
Fixes #18026.
2018-05-30 14:39:44 +02:00
Zirak c329780ea7 Editor autocomplete won't insert unnecessary quotes
When autocompleting a string (e.g. emit_signal or connect), e.g.

    emit_signal('visibility_c')
                            ^

where "^" is the cursor, hitting <tab> would insert an unnecessary
quote, breaking the string:

    emit_signal('visibility_changed'')

This commit adds a small lookahead, so the end result will be as the
user probably expected:

    emit_signal('visibility_changed')
2018-05-26 21:13:42 +00:00
Anish 5d3108acbb Ensures CMD+left and CMD+right only valid for OSX.
Fix in #18370 is now only valid for OSX and is reverted for other OS.

Fixes #19042
2018-05-24 15:04:22 +05:30
Ibrahn Sahir 2abec59db9 fix for TextEdit::set_text firing signals it shouldn't.
Removing some _changed signals in set_ functions.
Includes revert of commit 384625aa31
2018-05-19 19:38:13 +01:00
Rémi Verschelde d6c15bd96a
Merge pull request #19017 from toger5/fix_no_a_input_script_editor_osx
fixed capital A osx
2018-05-18 20:04:31 +02:00
toger5 6476b708d9 fixed capital A osx 2018-05-18 19:46:40 +02:00
Rémi Verschelde e8dce91481
Revert "Fix color-picker sliders" 2018-05-18 01:49:45 +02:00
Martin Capitanio c58e155580 Fix color-picker sliders 2018-05-17 23:27:29 +02:00
Juan Linietsky 4b5227ff77 -Ability to open resources in the same window
-Plenty of fixes and improvements to new inspector
-Fixes that were needed to make inspector work better
2018-05-17 18:03:05 -03:00
Rémi Verschelde 802ddc6e94
Merge pull request #18862 from endragor/remove-font-width-ceiling
Ceil char width within Label instead of Font
2018-05-17 09:31:22 +02:00
Juan Linietsky dfd1331690 Allow editing of some unbound properties when hinted (or no range hinted) 2018-05-16 09:13:41 -03:00
Juan Linietsky 031a445368 Add note about color picker deferred initialization 2018-05-16 08:04:46 -03:00
volzhs e639db0529 Fix segfault at quiting editor 2018-05-16 16:54:04 +09:00
Rémi Verschelde 69cafb6044
Merge pull request #18910 from PJB3005/18-05-15-fix-textedit-param
Fix missing registration for new param of TextEdit::cursor_set_line.
2018-05-16 02:38:21 +02:00
Rémi Verschelde 6f4a90592f
Merge pull request #18909 from ianb96/getcharwidthfix
fix get_char_width for non-latin characters
2018-05-16 02:32:40 +02:00
Juan Linietsky 005b69cf6e -New inspector.
-Changed UI resizing code, gained huge amount of speed.
-Reorganized timer sync to clean up behavior (sorry forgot commit this before)

-
2018-05-15 17:14:31 -03:00
Pieter-Jan Briers 0f303c9f43 Fix missing registration for new param of TextEdit::cursor_set_line.
This caused Mono glue gen to fail and other bugs to appear
(such as in Visual Script)
2018-05-15 21:53:42 +02:00
ianb96 ce434bca82 fix get_char_width for non-latin characters 2018-05-15 15:32:09 -04:00
Ian e1fff4bc09 TextEdit word wrap 2018-05-14 16:17:48 -04:00
Ruslan Mustakov d5a0b5f35b Ceil char width within Label instead of Font
Some classes use Font::get_char_size directly and not only for
autowrapping. RichTextLabel is one such example. So this commit
reverts aa8561d (PR #17504) and instead ceils character width within
Label. This makes sure Label autowraps correctly while not affecting
other Font clients.

Fixes #18835.
2018-05-14 20:32:14 +07:00
Rémi Verschelde dd2aba021c
Merge pull request #18853 from YeldhamDev/gui_cppcheck_fixes
Fixed some warnings found with Cppcheck
2018-05-14 07:39:54 +02:00
Michael Alexsander Silva Dias 7f72d6476b Fixed some warnings found with Cppcheck. 2018-05-14 02:14:56 -03:00
Hugo Locurcio 814989e106
Add support for bilinear bars in TextureProgress
These bars will extend from the center to the left and right of
the node, or from the center to the top and bottom of the node
depending on the option selected.

The Clockwise and Counter Clockwise mode will expand the progress
bar both ways in a circular fashion.
2018-05-12 10:23:06 +02:00
toger5 d927e972d1 fixed a input not registered in osx script editor 2018-05-11 04:30:05 +02:00