Commit graph

3299 commits

Author SHA1 Message Date
Rémi Verschelde
93dac1c7db
Merge pull request #51804 from ThreeRhinosInAnElephantCostume/fixundoredo 2021-08-19 17:49:01 +02:00
ThreeRhinosInAnElephantCostume
0aa13ecd30 fixed popup_menu buttons getting triggered by lmb press instead of release. 2021-08-19 15:56:33 +02:00
Michael Alexsander
9819be7562 Minor tweaks/fixes for the Command Palette 2021-08-18 13:12:14 -03:00
Rémi Verschelde
a031579286
Merge pull request #50752 from Phischermen/indeterminate_checkmark_api
Added icons and API for indeterminate checkmarks for the Tree class.
2021-08-18 10:31:06 +02:00
Hugo Locurcio
a139e58f8c
Add comments at the top of each built-in shader to ease debugging
When a shader error is printed about a built-in shader, the origin
of the shader will now be recognizable immediately by looking at
the top of the printed shader code.
2021-08-18 03:09:22 +02:00
Hendrik Brucker
ff9901f51e Reimplement ColorPicker presets 2021-08-18 02:09:48 +02:00
Haoyu Qiu
16c2d4ef22 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-17 21:11:10 +08:00
Rémi Verschelde
c4e03672e8
Merge pull request #51760 from requizm/fix/deleteallselection
Deletion occurs when all text is selected
2021-08-17 09:58:57 +02:00
requizm
37ad82a7f7 We can delete all text on TextEdit
While all text of TextEdit was selected, deletion with backspace did not occur. It can now be deleted.
2021-08-17 02:30:14 +03:00
Kevin Fischer
75866c81e7 Added icons and API for indeterminate checkmarks for the Tree class. 2021-08-16 10:13:06 -07:00
Rémi Verschelde
cfdac0973c
Merge pull request #51698 from Paulb23/text-editor-settings
Reorganise text editor settings
2021-08-16 18:48:58 +02:00
Paulb23
bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
Haoyu Qiu
6ca476b406 Fix MenuButton not emitting about_to_popup signal 2021-08-16 20:53:10 +08:00
Vignesh1-art
eb5b0d013f
Fixed crash executing TextEdit.new().set_draw_control_chars(true)
Fixes #51613.
2021-08-16 12:36:14 +02:00
Rémi Verschelde
2edc47caea
Merge pull request #51249 from kleonc/tab_container-fix-disconnecting-errors
TabContainer: Fix error on removing top-level Control child, Remove _get_tab method
2021-08-16 10:35:20 +02:00
Rémi Verschelde
966559c3bd
Merge pull request #51512 from Bhu1-V/PR/cmd-fix
command palette improvements
2021-08-15 16:01:49 +02:00
Bhuvan Vemula
a0205e4f34 command palette improvements 2021-08-15 11:40:44 +05:30
Rémi Verschelde
14a2e59875
Merge pull request #51642 from akien-mga/cleanup-use_single_quotes 2021-08-13 21:49:06 +02:00
Rémi Verschelde
761eb7e06a
Merge pull request #51585 from Paulb23/theme-update-optimisation 2021-08-13 21:33:36 +02:00
Rémi Verschelde
84461a5c91
Merge pull request #50609 from bruvzg/te_block_caret
[TextEdit] Improve block/insert caret drawing.
2021-08-13 21:33:02 +02:00
Rémi Verschelde
81512a3732
Style: Cleanup code using text_editor/completion/use_single_quotes 2021-08-13 21:27:57 +02:00
Paulb23
273374957b Only update TextEdit text cache when dirty 2021-08-13 17:47:53 +01:00
Paulb23
b6f5912174 Move CodeEdit theme overrides into EditorTheme 2021-08-13 17:47:53 +01:00
Yuri Roubinsky
6e87ff28ed Fix incorrect completion popup size of CodeEdit 2021-08-13 19:34:18 +03:00
bruvzg
00381db2e7 [TextEdit] Improve block/insert caret drawing. 2021-08-13 19:28:47 +03:00
Paulb23
b73983340d Add bulk theme overrides to Control 2021-08-13 16:41:36 +01:00
Aaron Franke
eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
Paulb23
a736fb8ce9 Fix breakpoint toggle signal not firing when expected 2021-08-12 14:47:10 +01:00
Rémi Verschelde
a695a6764e
Merge pull request #50371 from Paulb23/text_edit_cleanup 2021-08-12 15:30:12 +02:00
Paulb23
a4606c2806 Cleanup and complete TextEdit inspector and docs 2021-08-12 11:43:35 +01:00
Paulb23
ae4dcb8918 Cleanup and bind remaing methods in TextEdit 2021-08-12 11:43:35 +01:00
Yuri Roubinsky
810c30dc09
Merge pull request #51517 from Chaosus/precise_graphedit_port_handling
Better port handling connection for `GraphEdit`
2021-08-12 11:40:52 +03:00
Paulb23
0a32a6907b Cleanup and expose viewport / scrolling methods 2021-08-12 09:29:58 +01:00
Paulb23
7dbb0f3233 Rename readonly to editable 2021-08-12 09:29:58 +01:00
Paulb23
b799e5583a Rename insert mode to overtype mode 2021-08-12 09:29:58 +01:00
Paulb23
b700011314 Protect internal CodeEdit --> TextEdit API 2021-08-12 09:29:58 +01:00
Paulb23
9ec3e7f3d7 Cleanup TextEdit selection methods 2021-08-12 09:29:56 +01:00
Paulb23
7e70f9e0b9 Expose and cleanup TextEdit line wrap API 2021-08-12 09:29:16 +01:00
Paulb23
d5dcaee4c5 Cleanup and rename caret operations 2021-08-12 09:29:13 +01:00
Paulb23
e60900a353 Make TextEdit cut, copy and paste overridable 2021-08-12 09:27:10 +01:00
Paulb23
abbf14e7f5 Remove dead code from TextEdit 2021-08-12 09:27:10 +01:00
Rémi Verschelde
fba0c8e2e2
Merge pull request #51502 from codecat/fix-caret-selection
Move cursor to edge of selection when moving caret left/right
2021-08-12 10:07:12 +02:00
Yuri Roubinsky
61904d56ea Better port handling connection for GraphEdit 2021-08-12 09:09:24 +03:00
Melissa Geels
408401a642 Triple click in text editor now uses last mouse position for validity
Previously, you would be able to double click a word, followed by
single-clicking another word on the same line, which would select the
entire line. Now, it will only select the whole line if the mouse
position has remained the same after the double click. This mimicks the
behavior in most third party text editors.

Fixes #51312.
2021-08-11 21:49:26 +02:00
Melissa Geels
ed4c3eb7b3 Move cursor to edge of selection when moving caret left/right
This is to mimic the behavior of many third party text editors. The
reason it's not doing it when moving by word is due to that behavior
being mostly the same on other editors.
2021-08-11 13:27:12 +02:00
Rémi Verschelde
c00303ff55
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
2021-08-11 11:20:45 +02:00
Rémi Verschelde
2c88e1c15d
Merge pull request #51178 from Geometror/layout-options-textline-textparagraph
Various text layout improvements (TextLine, TextParagraph, Label, TextServer)
2021-08-11 07:51:57 +02:00
Hendrik Brucker
403f4902d0 Various text layout improvements (TextLine, TextParagraph, Label, TextServer) 2021-08-11 00:09:48 +02:00
Aaron Franke
fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
K. S. Ernest (iFire) Lee
18bd0fee5a
Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
2021-08-10 15:42:04 -04:00
Umang Kalra
12fc3f1eef Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this 
feature is compact, with minimum crossings between connections
& uniform horizontal & vertical gaps between the nodes. 

This work has been sponsored by GSoC '21.

Full list of additions/changes:
• Added arrange_nodes() method in GraphEdit module.
    • This method computes new positions for all the selected
      nodes by forming blocks and compressing them.
      The nodes are moved to these new positions. 
    • Adding this method to GraphEdit makes it available for 
      use in VisualScript/VisualShaders editors and its other
      subclasses. 
• Button with an icon has been added to call arrange_nodes() in GraphEdit. 
    • This button is inherited by VisualScript/VisualShaders editors
       to invoke the method.
• Undo/redo is functional with this method.
    • By using signals in arrange_nodes(), position changes are registered 
       in undo/redo stack of the subclass that is using the method. 
• Metadata of the method has been updated in ClassDB
• Method description has been added to class reference of GraphEdit
2021-08-11 00:44:28 +05:30
Rémi Verschelde
dce488d8f7
Merge pull request #49417 from Bhu1-V/gsoc-cmd-plt
Command Palette For Godot
2021-08-10 18:55:22 +02:00
Rémi Verschelde
536950f9f3
Merge pull request #21922 from aaronfranke/double
Some work on double-precision support
2021-08-10 07:41:46 +02:00
Nathan Franke
b57b8453b1
Follow-Up Add SNames to get theme icon 2021-08-09 17:50:26 -05:00
Aaron Franke
430ad75963
Some work on double support 2021-08-09 17:43:48 -05:00
Aaron Franke
84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Rémi Verschelde
0a38d5c8f7
Merge pull request #43158 from nathanfranke/fix-gradient-and-draw-tile
Fix Gradient and Color Picker checkerboard, Fix tile parameter for CanvasItem.draw_texture_rect
2021-08-09 16:47:58 +02:00
Bhuvan Vemula
a0a019a998 Added EditorCommandPalette 2021-08-09 17:41:50 +05:30
bruvzg
7c3c5603d0 [Text Server] Improve object (image/table) inline alignment. 2021-08-08 22:35:47 +03:00
Nathan Franke
051234e84e
Fix Gradient, Color Picker BG, Fix CanvasItem::draw_texture_rect p_tile 2021-08-07 16:40:50 -05:00
Paulb23
738b0fdae5 Redraw on item list custom bg/fg colour change 2021-08-07 12:08:46 +01:00
Rémi Verschelde
de2c2be19b
Shortcut: Rename shortcut property to event
Having a property which has the same name as its class leads to confusing
situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut`
which has a `shortcut` property of type `InputEvent`).

Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event`
to better reflect what the methods check.
2021-08-05 13:48:43 +02:00
kleonc
fd483c729f TabContainer: Fix error on removing top-level Control child, Remove _get_tab method 2021-08-04 21:13:10 +02:00
Rémi Verschelde
e0b560fb6f
Merge pull request #51177 from kleonc/tab_container-drop-tab-index-fix
TabContainer Fix moving dropped tab to incorrect child index
2021-08-03 09:34:51 +02:00
Hugo Locurcio
3ea3addc79
Improve CodeEdit's callhint highlight visibility
This makes the currently edited parameter more visible in the
script editor's code completion hint.
2021-08-02 23:16:16 +02:00
Rémi Verschelde
c620ede327
Merge pull request #50122 from Paulb23/code_edit_auto_brace_completion 2021-08-02 20:44:39 +02:00
kleonc
a5a4532378 TabContainer Fix moving dropped tab at incorrect child index 2021-08-02 14:15:51 +02:00
Gilles Roudière
ad8b5cd5a4 Implements TileMap layers and move TileSetPlugins's functions to the TileMap node instead 2021-08-02 13:54:39 +02:00
Paulb23
809a32c045 Clean up and complete CodeEdit inspector and docs 2021-08-01 12:24:19 +01:00
Paulb23
dd5a37f556 Move symbol lookup into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23
8f900ac178 Move line length guidelines into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23
d1a1ad127e Move brace matching into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23
12f0053555 Move auto brace completion to CodeEdit 2021-08-01 12:06:33 +01:00
Yuri Sizov
7137ebdaf6 Make theme item overrides more obvious in the Inspector 2021-07-31 23:46:24 +03:00
Michael Alexsander
b70b9c4ede Fix "Custom *" theme sections being inside "Auto Translate" 2021-07-30 13:55:07 -03:00
Michael Alexsander
94a64d557e Add auto_translate toggle for automatic translation 2021-07-29 18:30:34 -03:00
Michael Alexsander
79fc188fc4 Multiple cosmetic fixes for embedded windows 2021-07-27 23:55:06 -03:00
Michael Alexsander
478b6d6a13 Make switch_on_hover work on embedded windows 2021-07-26 14:45:26 -03:00
Rémi Verschelde
738205d923
Merge pull request #50835 from bruvzg/optimize_is_rtl
Optimise `is_layout_rtl`.
2021-07-25 12:55:46 +02:00
Rémi Verschelde
ff0b5f8fa1
Merge pull request #50809 from akien-mga/iterators-const-references 2021-07-25 12:52:58 +02:00
Rémi Verschelde
ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
luz paz
3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
bruvzg
9bb03e60d9 Optimise is_layout_rtl by caching its return value. 2021-07-25 10:33:00 +03:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
jfons
944b5ee639 Fix popup submenu in single-window mode
The internal processing code only works for OS windows, since it takes
the mouse position relative to the window and not the viewport. Now we
make sure it's not called in single-window mode.
2021-07-23 19:45:30 +02:00
Michael Alexsander
a690cd9251 Make MenuButton's switch_on_hover work again 2021-07-22 14:27:30 -03:00
PouleyKetchoupp
0b4037fe64 Fix logic for Popup closing when parent is focused
The member popped_up is used to avoid closing a Popup before it had a
chance to be focused. It wasn't reset properly when the popup is hidden,
causing the Popup to close right after showing in some random cases
(spotted on X11, might not happen on Windows).
2021-07-21 12:03:03 -07:00
Rémi Verschelde
693f9b4e20
Merge pull request #50655 from JFonS/sname_opt
Editor StringName and Viewport optimizations
2021-07-20 21:49:32 +02:00
Joan Fons
a6adb58493 Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
  is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
  that.
2021-07-20 20:35:41 +02:00
Rémi Verschelde
394191c02f
Merge pull request #50605 from Calinou/tweak-shader-code-style
Use C++11 raw literals for shader code to improve readability
2021-07-20 10:05:13 +02:00
Rémi Verschelde
a0bc2f359d
Merge pull request #50588 from bruvzg/menu_gen
Optimize LineEdit and TextEdit menu item generation.
2021-07-19 22:56:53 +02:00
Rémi Verschelde
dfc1ec7fb9
Merge pull request #50606 from Chaosus/textedit_fix_guttertype
Fixed typos in `TextEdit::GutterType` enum
2021-07-19 16:40:42 +02:00
Yuri Roubinsky
1597045b09 Fixed typos in TextEdit::GutterType enum 2021-07-19 11:18:54 +03:00
Hugo Locurcio
abc38b8d66
Use C++11 raw literals for shader code to improve readability
In files that have lots of branching, `\t` was replaced with a
tab character instead.
2021-07-19 08:19:50 +02:00
bruvzg
1ac7a126f1 Optimize LineEdit and TextEdit menu item generation. 2021-07-19 08:19:09 +03:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
reduz
a3fb76cd45 Create many types of popups on demand
* LineEdit popups created on demand.
* TextEdit popups created on demand.
* SpinSlider popups created on demand.
* ResourcePicker popups created on demand.

Improves editor responsiveness.
2021-07-17 10:57:14 -03:00
Rémi Verschelde
29c56f33a4
Merge pull request #48502 from KoBeWi/visual_button
Add set_pressed_no_signal method to BaseButton
2021-07-14 15:05:50 +02:00
kobewi
f4b361dd15 Add header theme type variations to labels 2021-07-13 15:42:09 +02:00
Rémi Verschelde
b44b277f6f
Merge pull request #50169 from pycbouh/theme-type-variations 2021-07-13 15:13:00 +02:00