Commit Graph

4822 Commits

Author SHA1 Message Date
QbieShay
237e3c6099 Fix regression in visual nodes hotzones 2023-06-22 19:03:17 +02:00
dinoplane
e11e9d2b9a Use cached saturation for color picker when value is 0 2023-06-21 15:18:20 -07:00
Markus Sauermann
890fdd56df Code simplifications
CPPcheck found most of them.

no need to assign the variable twice:
- AnimationTrackEditTypeAudio
- SSEffects

variable is assigned in all if-else clauses:
- EditorHelp
- AndroidInputHandler
- MenuBar
- ShaderCompiler

same if clause:
- ItemList

clearing an empty bitfield has no effect:
- Viewport
2023-06-21 22:37:26 +02:00
Dawid Marzec
9abbdea95e Fix cursor behaviour in Tree while holding CTRL 2023-06-21 20:44:29 +02:00
MewPurPur
6e182d41f4 Hide breakpoint indicator when mouse leaves CodeEdit 2023-06-21 11:30:40 +02:00
Markus Sauermann
a12627765f Embedded Popups store their safe_rect in their embedder
Storing it in the DisplayServer didn't make sense in this case,
because the embedded window is unknown to the DisplayServer.
2023-06-20 18:06:26 +02:00
Rémi Verschelde
94a4da9de6
Merge pull request #78236 from AThousandShips/nine_tex_fix
Make `NinePatchRect` listen to texture changes
2023-06-20 09:21:15 +02:00
Rémi Verschelde
0653f7a5b0
Merge pull request #77722 from ApplecrispEric/drag-drop-autocomplete
Cancel autocomplete after initiating drag
2023-06-20 09:20:52 +02:00
Ninni Pipping
4492f7ff97 Make NinePatchRect listen to texture changes 2023-06-20 08:40:35 +02:00
Eric Brown
42bc437615 Changed autocomplete to cancel when the user begins a drag 2023-06-19 15:44:13 -07:00
Ninni Pipping
75b355ee99 Add ability to set the tooltip text of a TreeItem button 2023-06-18 11:14:32 +02:00
Markus Sauermann
7f547fcf09 Fix focusloss of non-exclusive AcceptDialog with close_on_escape
Fix, that a non-exclusive AcceptDialog with `close_on_escape == true`
gets closed, when the parent window of the parent window receives focus.

There is no need to rely on the focus of the parent visible window.
Instead check if the AcceptDialog loses focus.
2023-06-17 11:05:36 +02:00
Rémi Verschelde
c65aba7aff
Merge pull request #78321 from ajreckof/fix-wrong-alphabetical-order-in-autocompletion-sorting
Fix wrong order in autocompletion sorting with empty string to complete.
2023-06-16 16:52:27 +02:00
ajreckof
e9a2060b27 Fix wrong alphabetical order in autocompletion sorting.
Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2023-06-16 14:04:07 +02:00
Markus Sauermann
390aa2a565 Fix ButtonGroup unpressing
It was possible to unpress a button group that had `allow_unpress = false`
using shortcuts.
Adjust `BaseButton::shortcut_input` to use the same logic as
`BaseButton::on_action_event`.
2023-06-16 00:15:37 +02:00
Rémi Verschelde
a48285db7b
Merge pull request #78269 from Sauermann/fix-menubutton-popup-position
Fix position and size of MenuButton popup
2023-06-15 16:08:40 +02:00
Rémi Verschelde
95a9089fdd
Merge pull request #74813 from bruvzg/text_edit_autowrap
[TextEdit] Expose all auto-wrap modes.
2023-06-15 16:08:21 +02:00
Markus Sauermann
d41665eb5e Fix position and size of MenuButton popup
Use the same logic as in OptionButton::show_popup
2023-06-15 15:29:50 +02:00
Rémi Verschelde
6587a81910
Merge pull request #78268 from Sauermann/fix-remove-unused-variable
Remove unused variable `PopupMenu::parent_rect`
2023-06-15 15:26:36 +02:00
Markus Sauermann
840e2b14f3 Remove unused variable PopupMenu::parent_rect
This private variable is not read anywhere.
Remove it and all places, where it is set.
2023-06-15 12:08:47 +02:00
bruvzg
cda9cd7587
[RTL] Fix multithreaded resizing. 2023-06-14 23:15:16 +03:00
bruvzg
38b8e23206
[RTL] Fix parsing tags with multiple features. 2023-06-13 15:24:30 +03:00
bruvzg
75e6ec8874
[TextEdit] Expose all auto-wrap modes. 2023-06-13 10:28:27 +03:00
bruvzg
488626701d
Fix editor log flicker. 2023-06-12 20:15:23 +03:00
Rémi Verschelde
fa536571a4
Merge pull request #77667 from RedworkDE/text-edit-selection-crash
Fix crash when selecting lines in text edit
2023-06-12 17:10:04 +02:00
Rémi Verschelde
b02dd1c2a3
Merge pull request #78092 from KoBeWi/must_protecc_selection
Preserve selection when focusing SpinBox
2023-06-12 14:14:44 +02:00
Rémi Verschelde
1b5620d2a9
Merge pull request #78009 from YuriSizov/gui-gently-massage-minimal-size
Ensure that controls update all their sizing information when required
2023-06-12 14:14:20 +02:00
Rémi Verschelde
9fdce6635b
Merge pull request #77880 from AThousandShips/get_node_fix
Use `get_node_or_null` when null checks are present
2023-06-12 11:39:54 +02:00
dinoplane
a374c7d519
Use cached hue for color picker when saturation is 0
Fixes #76968.
2023-06-12 10:59:33 +02:00
kobewi
e22319ced3 Use S, V in hue bar of ColorPicker 2023-06-11 01:37:29 +02:00
kobewi
968c5f6247 Preserve selection when focusing SpinBox 2023-06-10 21:29:24 +02:00
Ninni Pipping
0c16082e1e Use get_node_or_null when null checks are present
Avoids duplicate or unnecessary errors
2023-06-10 13:22:56 +02:00
Rémi Verschelde
37d1dfef9d
Merge pull request #78000 from RandomShaper/let_users_mess_up
Let user scripts disable thread safety checks
2023-06-10 12:12:13 +02:00
Ninni Pipping
dcd2b883eb Use NULL instead of COND checks when appropriate
Restricted to scene
2023-06-10 08:56:30 +02:00
Pedro J. Estébanez
2b001db76e Let user scripts disable thread safety checks 2023-06-09 18:24:01 +02:00
Rémi Verschelde
4d05edd75d
Merge pull request #77901 from bruvzg/rtl_canvas
Fix incorrect node placement in RTL layout when parent is non-Control canvas item.
2023-06-09 12:15:32 +02:00
bruvzg
b23f259e67
[Label] Add support for tab stops. 2023-06-09 12:59:37 +03:00
Rémi Verschelde
577ab3c565
Merge pull request #75746 from ajreckof/order_autocomplete
Sort code autocompletion with rules
2023-06-08 18:14:31 +02:00
Yuri Sizov
ccaab0e590 Ensure that controls update all their sizing information when required 2023-06-08 17:41:03 +02:00
Rémi Verschelde
bd62d8ee10
Merge pull request #77802 from dalexeev/tree-add-autowrap-mode
Tree: Add ability to configure text autowrap mode for individual cells
2023-06-07 11:02:02 +02:00
Yuri Sizov
df26066ce9 Revert "Make sure that data.last_minimum_size is consistent with get_combined_minimum_size() at the same time"
This reverts commit 594852caf1.
2023-06-06 20:55:03 +02:00
Rémi Verschelde
46c4068821
Merge pull request #77170 from lawnjelly/scu_build_master
Add support for single compilation unit builds
2023-06-06 17:58:09 +02:00
lawnjelly
b69c8b4791 Single Compilation Unit build.
Adds support for simple SCU build (DEV_ENABLED only).
This speeds up compilation by compiling multiple cpp files within a single translation unit.
2023-06-06 15:36:51 +01:00
Yuri Sizov
b99a02387d
Merge pull request #77856 from kinami-imai/videostreamplayer_seamless_loop
Fix VideoStreamPlayer seamless loop
2023-06-06 12:36:48 +02:00
bruvzg
66ea0006e0
Fix incorrect node placement in RTL layout when parent is non-Control canvas item. 2023-06-06 11:49:05 +03:00
今井きなみ
15719e278b Add loop property to VideoStreamPlayer 2023-06-05 21:37:11 +02:00
今井きなみ
e3da9176a0 Expose VideoStreamPlayer video length 2023-06-05 21:30:38 +02:00
今井きなみ
270bc93b95 Fix VideoStreamPlayer seamless loop 2023-06-05 21:17:48 +02:00
Hugo Locurcio
70e6c3cbb0
Add a [pulse] built-in effect to RichTextLabel
In games, blinking text is one of the more frequently used animations.
It can be (sparingly) used to bring attention to important messages
in a chat log or inventory tooltip, for instance.

This effect accepts the following options:

- `freq`: How fast text blinks (higher is faster).
- `color`: The target color multiplier for blinking.
  The default mostly fades out text, but not entirely (for better accessibility).
- `ease`: The easing function exponent to use.
  Negative values provide in-out easing, which is why `-2.0` is the default.
2023-06-05 18:45:00 +02:00
Rémi Verschelde
e7d2e49688
Merge pull request #77765 from Sauermann/fix-acceptdialog-event-handled
Fix that button presses don't set event as handled in AcceptDialog
2023-06-05 18:27:33 +02:00
Rémi Verschelde
f00c971b81
Merge pull request #63168 from Levrault/master
Fix: InputEventJoypadMotion should trigger only once on a vslider
2023-06-05 18:04:39 +02:00
Luc-Frédéric Langis
166ca77f20 feat(gamepad): improve gamepad behavior with slider and popup_menu 2023-06-05 10:20:46 -04:00
Danil Alexeev
010829f962
Tree: Add ability to configure text autowrap mode for individual cells 2023-06-03 15:17:35 +03:00
Aaron Franke
8b42297d7c
Make Viewport::gui_get_focus_owner const 2023-06-02 12:36:10 -05:00
Aaron Franke
d3e4db4a7b
Fix crash when removing SpinBox during text submit 2023-06-02 10:29:22 -05:00
Yuri Sizov
ca1b4eb225
Merge pull request #77651 from Rindbee/fix-update-minimum-size
Make sure that `data.last_minimum_size` is consistent with `get_combined_minimum_size()` at the same time
2023-06-02 14:02:04 +02:00
Yuri Sizov
6a1d3198d1
Merge pull request #76854 from CapitaineCookie/fix-change-type
Fix crash when changing node type from PopupMenu to ItemList
2023-06-02 13:03:55 +02:00
João Pedro Braz
670b7bec9a Add the "inner_item_margin" Theme constant to the Tree control
This PR adds the "inner_item_margin" Theme constant to the Tree Control.
It behaves like a horizontal padding (in CSS), but only in the active
writing direction (So on LTR it'll apply a left padding and on RTL right
padding).

The Editor Theme has been updated to make use of this and a result items
in Trees and ItemLists no longer "hugs" their border, expressing a proper
spacing instead.
2023-06-02 11:32:40 +02:00
Markus Sauermann
dc434ef849 Fix that button presses don't set event as handled in AcceptDialog 2023-06-02 11:06:41 +02:00
Rindbee
594852caf1 Make sure that data.last_minimum_size is consistent with get_combined_minimum_size() at the same time
Move the code for switching `data.minimum_size_valid` in `Control::update_minimum_size()`
to `Control::_update_minimum_size()`, make sure to switch `data.minimum_size_valid` to
`false` only before updating `data.last_minimum_size` , so that it will remain consistent
with `get_combined_minimum_size()`.
2023-06-01 19:02:42 +08:00
Yuri Sizov
3ed7bdc26f Implement TreeItem.add_child 2023-05-31 11:36:23 +02:00
RedworkDE
6b7008b73b Fix crash when selecting lines in text edit 2023-05-30 20:32:44 +02:00
Yuri Sizov
6dd5ccdedd
Merge pull request #66625 from Sauermann/fix-move-child-update
Create a virtual mouse move event after moving child nodes in tree
2023-05-30 15:57:21 +02:00
Rémi Verschelde
df30c9d6e7
Merge pull request #77507 from Igorrreha/fix/line-edit-expanding-to-text
Fix LineEdit expanding to text length
2023-05-30 09:32:30 +02:00
Markus Sauermann
ce10ca6979 Create a virtual mouse move event after moving child nodes
This updates mouse cursor and mouse-over-states without the need
for additional mouse movements.
2023-05-29 22:46:19 +02:00
Yuri Sizov
f3983b59f4
Merge pull request #77159 from AThousandShips/texture_button_fix
Make `TextureButton` and `Button` update on texture change
2023-05-29 17:31:32 +02:00
Yuri Sizov
ee7b26403b
Merge pull request #77433 from YuriSizov/editor-reparented-popups-fix
Fix auto-reparenting logic in the `ProgressDialog`
2023-05-29 17:30:46 +02:00
Yuri Sizov
4c5c7cbb58 Fix auto-reparenting logic in the ProgressDialog
* Make sure `Popup` signals are disconnected when unparented.
* Remove a fail condition from `Window::is_embedded` when
not in tree.
2023-05-29 17:02:16 +02:00
Ninni Pipping
d4ac3b6ded Make TextureButton and Button update on texture change 2023-05-29 16:40:56 +02:00
bruvzg
be42ff0ef4
Fix MenuBar item order in RTL layout. 2023-05-29 17:03:49 +03:00
Igorrreha
d8886e1a0c Fix LineEdit expanding to text length
Fix for issue #77474

Remove wrong tab

Change the comment to more relevant

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-05-26 23:42:03 +07:00
Ninni Pipping
44a5b710f5 Unify item indexing in PopupMenu 2023-05-24 15:58:50 +02:00
Rémi Verschelde
5562100d33
Merge pull request #77411 from saki7/control-get_drag_data-const
Expose `Control::_get_drag_data()` as non-const function
2023-05-24 08:49:57 +02:00
Rémi Verschelde
a1058313a9
Merge pull request #75622 from joao-pedro-braz/parse_string_paths_with_quotes_correctly_bb_code
Make sure to normalize subtags when parsing BBCode
2023-05-24 08:45:35 +02:00
Rémi Verschelde
3512d18884
Merge pull request #71040 from marzecdawid/fix-input-lock-in-tree
Remove up/down input for text search in Tree
2023-05-24 08:43:27 +02:00
Rémi Verschelde
adbdf9a86e
Merge pull request #77234 from RandomShaper/fix_rtl_mt
Allow threads to mark themselves as safe for nodes
2023-05-24 08:42:59 +02:00
Pedro J. Estébanez
e725b4b02b Allow threads to mark themselves as safe for nodes 2023-05-24 00:22:58 +02:00
João Pedro Braz
8b6e57256f Make sure to normalize subtags when parsing BBCode
This PR makes it so that all subtags are normalized before usage.
Normalization means removing any leading and/or trailing quotation marks
from any given subtag.

Fixes: https://github.com/godotengine/godot/issues/75501
2023-05-23 18:55:06 -03:00
Nana Sakisaka
3dbd47ecb6 Expose Control::_get_drag_data() as non-const function 2023-05-24 06:09:45 +09:00
Dawid Marzec
9fe1d6aa27 Remove up/down input for text search in Tree 2023-05-23 21:41:10 +02:00
Rémi Verschelde
8f9e0672fb
Merge pull request #77297 from puchik/popup-close-key-mapping
Use defined key mapping for closing popups and dialogs
2023-05-23 19:14:31 +02:00
ajreckof
006e899bb3 sort code completions with rules
Fixups

Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible

Trying again to improve code completion

Sort code autocompletion options by similarity based on input

To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random.

It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches.

Also moves CodeCompletionOptionCompare to code_edit.cpp

Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
2023-05-23 05:12:34 +02:00
Rémi Verschelde
a30a55dd1f
Merge pull request #77166 from bruvzg/item_list_rtl
[ItemList] Fix item text positions in RTL mode.
2023-05-22 13:48:54 +02:00
Rémi Verschelde
0f0f233d37
Merge pull request #76751 from anvilfolk/swatch
Fix adding colors to swatches not updating in previous ColorPickers.
2023-05-22 13:48:43 +02:00
Rémi Verschelde
405fe7aa1a
Merge pull request #76401 from bruvzg/rtl_tab_stops
[RichTextLabel] Add support for tab stops.
2023-05-22 13:48:35 +02:00
Rémi Verschelde
5ac6e9232b
Merge pull request #74962 from KoBeWi/pick_outside_the_box
Improve color picking
2023-05-22 13:48:26 +02:00
ocean (they/them)
a132ed0ca4 Fix adding colors to swatches not updating in previous ColorPickers.
ColorPicker was only updating colors if its swatches were empty. It
should always update from the cache in case some other ColorPicker
updated the swatch cache.
2023-05-21 17:50:14 -04:00
Arman Elgudzhyan
8ab2cf3d2d Use defined key mapping for closing popups and dialogs
As opposed to hardcoding the escape key. Also removed such hardcoding in a few other places as well as a hardcoded enter key in one of the affected input fields.
2023-05-20 17:39:59 -07:00
bruvzg
fb78889904
[RichTextLabel] Add support for tab stops. 2023-05-20 22:58:51 +03:00
bruvzg
343c35e7b0
[ItemList] Fix item text positions in RTL mode. 2023-05-20 22:58:02 +03:00
Yuri Sizov
605e25656f
Merge pull request #77242 from novalis/slider-remove-active
Stop dragging when `Slider` changes editability
2023-05-19 17:17:13 +02:00
David Turner
7d6b44c5a4 Stop dragging when a slider changes editability 2023-05-19 10:20:42 -04:00
kobewi
b76ddeda45 Improve color picking 2023-05-19 14:21:43 +02:00
Rindbee
9bd1d3b5c8 Update size or size cache when toggling expand_icon in Button
When the `expand_icon` is switched, the size cache can be updated to
solve the issue that the cache cannot be updated when the `OptionButton`
is enabled with `fit_to_longest_item`.
2023-05-17 06:06:25 +08:00
Rémi Verschelde
d61827af05
Merge pull request #76605 from Rindbee/fix_get_visible_line_count
Fix calculation bug with `TextEdit::get_line_height()`
2023-05-16 10:59:52 +02:00
Rémi Verschelde
59c19a7172
Merge pull request #75250 from bruvzg/lbl_rtl_jst_flags
Expose TextServer justification flags to Label, Label3D, TextMesh and RTL. Add flags to control last/single line justification.
2023-05-16 10:48:45 +02:00
Rémi Verschelde
8cfa19a078
Merge pull request #77000 from reduz/make-more-base-nodes-thread-safe
Make more base nodes thread safe
2023-05-16 00:31:56 +02:00
bruvzg
9163d8c336
Expose TextServer justification flags to Label, Label3D, TextMesh and RTL. Add flags to control last/single line justification. 2023-05-15 19:23:54 +03:00
Juan Linietsky
0a9f72d5a8 Make more base nodes thread safe
Ongoing work to make more of the base nodes thread safe.
2023-05-15 16:54:10 +02:00
Rindbee
391bce44b7 Fix calculation bug with TextEdit::get_line_height()
When `get_line_height()` is less than `1`, there is no visible text.
So limit the return value of `get_line_height()` to **not less** than
`1` for calculation.
2023-05-15 07:16:00 +08:00