Commit Graph

4351 Commits

Author SHA1 Message Date
Rémi Verschelde f33e482551
Merge pull request #68531 from marzecdawid/fix-gap-with-scrolling-down-in-Tree
Fix a gap with scrolling down in Tree with arrow keys (#57636)
2022-11-14 23:25:22 +01:00
Dawid Marzec c068a9d0bd Fix a gap with scrolling down in Tree with arrow keys (#57636) 2022-11-14 21:37:42 +01:00
Markus Sauermann 3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
Rémi Verschelde 5b3a03bf5c
Merge pull request #68448 from bruvzg/font_imp_tr
[Font] Add an import option to pre-render all glyphs required for the translation.
2022-11-14 11:12:01 +01:00
Dawid Marzec 5cd30be56d Remove auto selecting the first file for FileDialog with Save file mode selected 2022-11-13 02:24:17 +01:00
Markus Sauermann 95597bb2ac Fix position and size of OptionButton PopupMenu
Use the correct Transform2D (get_global_transform_with_canvas) for
position and size.
2022-11-12 21:12:02 +01:00
bruvzg 35528b800c
[Font] Add an import option to pre-render all glyphs required for the translation. 2022-11-10 10:43:15 +02:00
bruvzg c624b1eeac
[Line Edit] Ignore placeholder text when drawing caret. 2022-11-08 15:15:13 +02:00
kobewi d9f066d5fa Remove duplicate project settings definitions 2022-11-08 01:29:39 +01:00
Rémi Verschelde a1bc636098
Merge pull request #68337 from alfredbaudisch/multi-caret-selection-fix
Fixes mouse click deselect for multi and single carets
2022-11-07 10:20:45 +01:00
Markus Sauermann 18978881fe Code simplifications
CanvasItemEditor:
- p_result == ADD_MOVE is always true in this switch-clause

- both parts of the if-else-clause do the same thing and simplified an affine_inverse call

ControlEditorToolbar:
- private function ControlEditorToolbar::_anchor_to_position is used nowhere. Looks like
copy and paste from CanvasItemEditor::_anchor_to_position

ScrollContainer:
- screen_is_touchscreen is always true, because otherwise the function already returned

TextLine:
- both parts of the if-else-clause do the same thing and simplified return statement
2022-11-07 01:21:25 +01:00
Alfred Reinold Baudisch 0d2953074b Mouse click deselect removes secondary carets and puts primary caret under mouse position
Fixes and closes #67993.
2022-11-06 20:03:06 +01:00
Rémi Verschelde cf1e6bb6fc
Merge pull request #68282 from alfredbaudisch/backspace-multi-care
Correctly deletes multi-caret selection with backspace
2022-11-06 16:10:32 +01:00
Alfred Reinold Baudisch 7127e57bf8 Pass caret index when deleting selection with backspace
Fixes and closes #67992
2022-11-05 08:55:18 +01:00
kobewi 1778301cd0 Add call_deferred() method to Callable 2022-11-04 17:24:34 +01:00
Rémi Verschelde 4e47324b3f
Merge pull request #68097 from KoBeWi/no_signal🔕
Add `set_value_no_signal()` to Range
2022-11-04 10:48:47 +01:00
Rémi Verschelde d48ba545ef
Merge pull request #67741 from cridenour/modular-color-picker
Modularize the Color Picker via properties and new picker mode.
2022-11-04 10:48:37 +01:00
Chris Ridenour 286e7da162 Modularize the Color Picker via properties. 2022-11-04 00:08:46 -04:00
Rémi Verschelde 3cde6c0432
Merge pull request #67540 from KoBeWi/hue_hue_hue
Add a separate hue gradient for OKHSL mode
2022-11-03 11:51:45 +01:00
Rémi Verschelde c9e0d787fe
Merge pull request #67928 from YeldhamDev/we_really_need_a_callback_for_after_children_is_removed
Fix problems with `tab_changed` signal when removing multiple tabs at once
2022-11-02 22:36:49 +01:00
Markus Sauermann 022d24a9ae Fix Viewport root order after Node2D raise 2022-11-02 21:45:00 +01:00
Rémi Verschelde f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Rémi Verschelde 39cece382d
Merge pull request #68170 from alfredbaudisch/clear-selection-shortcut
Unified shortcut to clear carets and selections from TextEdit
2022-11-02 18:54:19 +01:00
Rémi Verschelde 7488b4724e
Merge pull request #67788 from 98teg/flow-container-alignment
Add alignment options to flow container
2022-11-02 18:52:53 +01:00
Alfred Reinold Baudisch a862583d05 Unified shortcut to clear carets and selections
Refactors`ui_text_remove_secondary_carets` from https://github.com/godotengine/godot/pull/68089 as `ui_text_clear_carets_and_selection`, with extra behaviour:

- If there's only one active caret active with a selection, clears the selection.
- In case there's more than one caret active, removes the secondary carets and clears selections.

With this change, `TextEdit` then imitates the behaviour of VSCode for clearing carets and selections.
2022-11-02 18:23:24 +01:00
Rémi Verschelde 06c8e406e4
Merge pull request #63335 from Spartan322/button-shortcut-feedback
Make `BaseButton` Shortcut feedback togglable
2022-11-02 17:14:00 +01:00
kobewi 84d6549c75 Change hue icons to horizontal GradientTexture2D 2022-11-02 15:34:15 +01:00
kobewi f5981ff19d Add a separate hue gradient for OKHSL mode 2022-11-02 14:44:41 +01:00
Rémi Verschelde eddaab17ea
Merge pull request #63562 from Rindbee/better-scroll-conditions
Use more reasonable scrollable conditions in `ScrollContainer`
2022-11-02 14:21:21 +01:00
Rémi Verschelde 87cdc2ea60
Merge pull request #67994 from YeldhamDev/how_suggestive
Stop centering clicked suggestions in the autocomplete popup
2022-11-02 14:15:32 +01:00
kobewi 4aa1efb0fe Add set_value_no_signal() to Range 2022-10-31 23:59:01 +01:00
Alfred Reinold Baudisch fcff978763 Shortcut and Bind to Remove Secondary Carets
Adds the bind `ui_text_remove_secondary_carets` to TextEdit, with ESC as the default shortcut.

When the bind is performed, if the TextEdit has multiple carets, `remove_secondary_carets` is called and secondary carets are removed.

This is useful when multiple selects are performed with `add_select_for_next_occurrence` #67644 or when multiple multiple carets are manually added, then it's possible to go back to a single caret with a shortcut.

Closes #67991
2022-10-31 17:44:47 +01:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde be126d42d4
Merge pull request #67588 from KoBeWi/if(!GDVIRTUAL_CALL)don't
Simplify GDVIRTUAL_CALL calls
2022-10-31 11:55:56 +01:00
Rémi Verschelde 33c7c8020a
Merge pull request #67489 from timothyqiu/auto-select-all
Allow selecting SpinBox & LineEdit text when focus enters
2022-10-31 11:55:06 +01:00
Rémi Verschelde b6cbea5e58
Merge pull request #63590 from golfinq/fbg-padding
Add padding options in theme for fg/bgcolor tags in RichTextLabel
2022-10-31 11:14:55 +01:00
Rémi Verschelde 8b1a42cd47
Merge pull request #67888 from KoBeWi/overridead
Remove `override_selected_font_color` property
2022-10-31 10:59:07 +01:00
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Rémi Verschelde d831ba1d6f
Merge pull request #67534 from KoBeWi/more_OK_in_OKHSL
Improve ColorPicker sliders in OKHSL mode
2022-10-31 10:37:27 +01:00
Rémi Verschelde 68623c75b3
Merge pull request #67496 from Paulb23/text-edit-crashes
Fix TextEdit action and CodeEdit completion crash
2022-10-31 10:32:41 +01:00
Rémi Verschelde 273410ba5a
Merge pull request #67139 from PucklaMotzer09/insert_caret_at_carets
Add Caret Insert Below and Above shortcuts to TextEdit
2022-10-31 10:32:07 +01:00
Rémi Verschelde 996f7e5142
Merge pull request #66352 from arkology/progressbar_atlastexture_radial
Support AtlasTexture in radial modes of TextureProgressBar
2022-10-31 10:31:07 +01:00
Haoyu Qiu 3aed3edc06 Allow selecting SpinBox & LineEdit text when focus enters 2022-10-29 09:58:42 +08:00
Michael Alexsander 4b6e6c6758 Stop centering clicked suggestions in the autocomplete popup 2022-10-28 20:22:28 -03:00
Clay John 0486810697
Merge pull request #67644 from alfredbaudisch/add-selection-next-occurrence
Add Selection and Caret for Next Occurrence of Selection
2022-10-27 17:21:49 -07:00
Michael Alexsander fb8588e68e Fix problems with `tab_changed` signal when removing multiple tabs at once 2022-10-27 03:16:01 -03:00
kobewi c7eb814ede Remove override_selected_font_color property 2022-10-26 12:59:18 +02:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Clay John 4134f2a464
Merge pull request #67566 from Sauermann/fix-code-simplifications
Code simplifications
2022-10-23 17:02:04 -07:00
Teggy 2b08675f37 Add alignment options to flow container 2022-10-23 13:40:17 +02:00
Alfred Reinold Baudisch 7d15ecc3af Add Selection and Caret for Next Occurrence of Selection
Adds the bind `add_selection_for_next_occurrence` to TextEdit, with CTRL+D as the default shortcut.

When the bind is performed, ff a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence.

If no selection is currently active with the last caret in text fields, selects the word currently under the caret.

The action can be performed sequentially for all occurrences of the selection of the last caret and for all existing carets. The viewport is adjusted to the latest newly added caret.

The bind and the behaviour is similar to VS Code's "Add Selection to Next Find Match" and JetBrains' "Add Selection for Next Occurrence". It takes advantage of the multi-caret API.

The default shortcut for `select_word_under_caret` has been changed to ALT+G, in order to give priority to CTRL+D for `add_selection_for_next_occurrence` to better align with popular IDEs and editors.
2022-10-21 08:26:53 +02:00
Rindbee 075e79bf04 Improve validation when setting `max`/`min`/`page` in `Range`
The incoming value is validated first and then compared.

Previously, when the ScrollContainer was scrolled, the ScrollBar of
the other axis of the ScrollContainer would emit the changed signal.
This commit avoids that.
2022-10-20 14:04:09 +08:00
George L. Albany d846dd6e91
Make `BaseButton` Shortcut feedback togglable 2022-10-20 02:02:12 -04:00
Max Hilbrunner d148613bb1
Merge pull request #66279 from aaronfranke/control-min-size
Revert `custom_minimum_size` type back to `Vector2` instead of `Vector2i`
2022-10-19 22:40:52 +02:00
kobewi d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
kobewi b42c1f82fc Improve ColorPicker sliders in OKHSL mode 2022-10-18 23:59:55 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann b8031bb7d6 Code simplifications
1. Viewport::get_visible_rect().position is always zero.
So Control::get_window_rect is identical to Control::get_global_rect.
Remove Control::get_window_rect since it is not used in the source code.

2. sqrt(a * a) = abs(a) for doubles

3. Simplify affine_inverse combination

4. Simplify calculation in shaders
2022-10-18 12:47:40 +02:00
PucklaMotzer09 e5354cacd0 Add Caret Insert Below and Above shortcuts to TextEdit 2022-10-18 10:38:53 +02:00
Rindbee 42073fc2bb Use more reasonable scrollable conditions in `ScrollContainer`
The visibility of the `ScrollBar` was used as a condition for judging whether it should scroll.
**Visible** and **scrollable** are currently not the same in some cases (`SCROLL_MODE_SHOW_NEVER`).
This makes `SCROLL_MODE_SHOW_NEVER` not working properly.

This patch will make `SCROLL_MODE_SHOW_NEVER` available, so that the external `SrollBar` can
share the internal `ScrollBar`'s data, we can achieve the purpose of replacing the internal
`ScrollBar` with a custom external one.
2022-10-18 16:32:39 +08:00
arkology 825f5671f1 Support AtlasTexture in radial modes of TextureProgressBar 2022-10-17 20:44:25 +03:00
Paulb23 4bfb1d953c Fix undo redo not adjusting TextEdit viewport to caret 2022-10-16 19:30:03 +01:00
Paulb23 b5dc8e24be Fix crash in code completion when using an invalid / null font 2022-10-16 16:47:27 +01:00
Paulb23 76005e5ff7 Forcibly end current TextEdit action on undo redo 2022-10-16 16:28:22 +01:00
bruvzg 4b1937c73f Abort LineEdit shaping if no font is set to avoid unnecessary error messages. 2022-10-14 12:57:42 +03:00
Rémi Verschelde f32f5b70d8 Merge pull request #67348 from Mickeon/salvage-a-dear-comment
Comment not to remove `data` structs in some Nodes
2022-10-13 18:40:58 +02:00
Micky de9e08da76 Comment not to remove `data` structs in some Nodes 2022-10-13 15:52:35 +02:00
Rémi Verschelde 2ffb609658 Merge pull request #66337 from EricEzaM/sprite-frames
Ensure control built-in shortcuts are matched exactly & add shortcuts for SpriteFrames editor
2022-10-13 15:24:39 +02:00
Rémi Verschelde 17db8be33c Merge pull request #66357 from EricEzaM/shortcut-context-on-node
Move Shortcut Context to control and fix `shortcut_input` with `shortcut_context`
2022-10-13 15:24:30 +02:00
Eric M a3ed9e6f2c Move Shortcut Context to Control and ensure that `shortcut_input` adheres to contexts. Also ensure that controls with no context are only triggered AFTER nodes which do have a context. 2022-10-13 21:07:19 +10:00
MladoniSzabi 3550354fd3 fixed holding alt while zooming zooms in by 2 increments. 2022-10-13 11:38:25 +01:00
Rémi Verschelde fad0327503 Merge pull request #66953 from Sauermann/fix-top-level-connect-error
Fix Control node not disconnecting from signal
2022-10-13 09:04:25 +02:00
Rémi Verschelde 15b68f7601 Merge pull request #67232 from bruvzg/popup_edit
Improve Popup / Window behavior in the edited scene tree.
2022-10-12 14:45:14 +02:00
Paulb23 f3eb543e67 Fix select word under caret using caret col instead of line 2022-10-11 20:32:06 +01:00
Rémi Verschelde f21053d189 Merge pull request #67201 from progsource/richtextlabel-icon-spritesheet
Add Spritesheet support to RichTextLabel BBCode
2022-10-11 13:58:54 +02:00
Petra Baranski 546e017613 Add Spritesheet support to RichTextLabel BBCode
BBCode: [img region=0,0,16,16]res://icon.svg[/img]
2022-10-11 13:04:15 +02:00
bruvzg 2e1fcbe14b
Prevent `Popup`s it the edited scene tree from closing on focus loss. Hide irrelevant `Popup` flags from the editor inspector. 2022-10-11 08:55:00 +03:00
Rémi Verschelde 8017827144 SCons: Re-enable treating `#warning` as error with `werror`
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
Rémi Verschelde ddb97a0b35 Merge pull request #67117 from Jummit/tree-button-color
Expose TreeItem::set_button_color
2022-10-10 13:52:57 +02:00
Rémi Verschelde 4be5660223 Merge pull request #67145 from Paulb23/tab_textedit
Fix inserting tabs in TextEdit
2022-10-10 13:52:42 +02:00
Rémi Verschelde 104af08e9d Merge pull request #65805 from MewPurPur/improve-breakpoint-hovering
Improve bookmark and breakpoint indicators
2022-10-10 10:03:26 +02:00
VolTer d6e60f45a1 Improved breakpoints hover indicator 2022-10-10 04:36:45 +02:00
Haoyu Qiu eac9adf7a1 Don't allow removing TextEdit's main caret 2022-10-10 08:30:23 +08:00
Paulb23 7333aa68f4 Handle tab in TextEdit 2022-10-09 17:46:40 +01:00
Jummit a6c1cfae99 Allow drag-clicking before symbol lookup
This makes it easier for touch and tablet users to do symbol lookups in
the code editor.
2022-10-09 18:42:54 +02:00
Rémi Verschelde 6f6482e82b Merge pull request #67083 from RedMser/label-font-warning
Add warning for missing characters in label font
2022-10-09 18:29:06 +02:00
Rémi Verschelde 49be2d2cf8 Merge pull request #66524 from microaeris/aeris/text-edit-get-scroll-bar
Getters for TextEdit scroll bars
2022-10-09 18:27:30 +02:00
Rindbee 3f20108703 Improve caret drawing conditions for `LineEdit`
Now, `caret_can_draw` will be validated when a condition that affects
the drawability of the `LineEdit`'s caret changes; `draw_caret` will
be toggled when the caret's visibility is toggled due to blink, and
`draw_caret` will be `false` when `caret_blink_enabled` is disabled.

Fix toggling `caret_blink_enabled` could cause caret to no longer be
displayed.
Fix opening the context menu causing caret to no longer appear.
2022-10-09 22:14:40 +08:00
Jummit 1e28675560 Expose TreeItem::set_button_color 2022-10-09 10:37:55 +02:00
Haoyu Qiu 2a921cc9f8 Fix Label text length mismatch after localization 2022-10-08 23:07:19 +08:00
RedMser 9579d49820 Add warning for missing characters in label font 2022-10-08 17:02:25 +02:00
microaeris 215fe852b8 Getters for TextEdit scrollbars 2022-10-07 23:16:04 -07:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Rémi Verschelde 5b7f62af55 Merge pull request #62910 from Vitika9/gsoc-colorpicker-ux
ColorPicker UX
2022-10-07 09:49:29 +02:00
bruvzg a750ca7ec1
Add split caret direction markers. Fix block/overtype caret size. 2022-10-07 08:45:52 +03:00
Rémi Verschelde d414872bfe Merge pull request #66961 from Rindbee/fix-set_custom_color
Fix wrong condition used in `set_custom_color`
2022-10-06 08:56:52 +02:00
Rémi Verschelde f5903215d0 Merge pull request #61902 from Paulb23/multi-caret
Add Multi-caret support to TextEdit
2022-10-06 08:56:34 +02:00
Rindbee f359abbe01 Fix wrong condition used in `set_custom_color` 2022-10-06 12:09:02 +08:00
Markus Sauermann c0f0f26615 Fix Control not disconnecting signal
If a Control has not parent CanvasItem and is set as top_level, then it does not disconnect from the "size_changed" signal when it leaves the Canvas.
This patch corrects this.
2022-10-05 23:35:44 +02:00
Paulb23 e9180241e8 Add multi caret support to CodeEdit 2022-10-05 17:19:26 +01:00