Commit Graph

1465 Commits

Author SHA1 Message Date
DualMatrix 7624e1009a Fixed !is_inside_tree() errors in file dialog
Fixed !is_inside_tree() errors appearing when current_file has a . in it.

(cherry picked from commit 2b13938459)
2019-07-03 13:57:37 +02:00
Hein-Pieter van Braam 68d09255bd Call minimum_size_changed() in PopupMenu::remove_item()
When removing an item from a PopupMenu we need to update the control's
size cache otherwise the size of the PopupMenu itself lags behind by 1
item size. Meaning the PopupMenu will remain too large.

(cherry picked from commit 2d032c1562)
2019-07-03 13:56:06 +02:00
Hein-Pieter van Braam e4733c5fc4 Delay emitting pressed signals in PopupMenu
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. But before hiding the popupmenu itself.

Thanks to @reduz for writing the whole solution.

This fixes #19842

(cherry picked from commit fa7eac8a0d)
2019-07-03 13:55:23 +02:00
Thomas ten Cate 2e34a922f0 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

(cherry picked from commit 44d761e55c)
2019-07-03 13:35:41 +02:00
Rémi Verschelde 392d988228 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.

(cherry picked from commit 13239cd4cc)
2019-07-03 13:23:10 +02:00
Ibrahn Sahir 33a93311ec 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.

(cherry picked from commit e51a94905d)
2019-07-03 13:07:12 +02:00
Will Nations f4db382c50 Fix underline_meta not working in RichTextLabel
(cherry picked from commit a9ea06e73a)
2019-07-03 12:43:24 +02:00
Rémi Verschelde 0eab0d9343 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-03 11:41:35 +01:00
M. Huri 7e8736a47d [Docs] Fixed 'get_button_count's link and a typo related to 'button'.
(cherry picked from commit 967831d9a0)
2018-11-01 11:39:25 +01:00
volzhs a34daf6851 Fix segfault at quiting editor
(cherry picked from commit e639db0529)
2018-07-08 15:39:15 +02:00
Hugo Locurcio 403f7dc35f Change ".." punctuation for "..." in editor strings (#16507)
(cherry picked from commit 1c419531a0)
2018-06-05 21:42:33 +02:00
toger5 b04c9a1b66 fixed capital A osx
(cherry picked from commit 6476b708d9)
2018-06-01 17:43:28 +02:00
toger5 dd026c77e3 fixed a input not registered in osx script editor
(cherry picked from commit d927e972d1)
2018-06-01 17:43:14 +02:00
Sherjil Ozair 00bf66d7f2 Add additional macos shortcuts for going to start/end of line
(cherry picked from commit 166c7fdc9d)
2018-06-01 17:43:10 +02:00
Hugo Locurcio 8ccb27ce18 Tweak the property hint ranges of caret blink and line length guideline
This allows for more precise adjustments.

(cherry picked from commit 0eb2f6c223)
2018-05-13 22:36:21 +02:00
robfram a187fb381e Fix placeholders position in `LineEdit` when editing inside the Editor
Editing the `Text` property through the editor causes a wrong
placement of the placeholder, as it calls `LineEdit::clear_internal`,
which was wrongly reseting the cached placeholder width.

Fix #18184.

(cherry picked from commit c17de1f70f)
2018-05-13 22:19:42 +02:00
Charly Mourglia 10c12b37ec Consider TextEdit paste operation complex.
Not considering a paste operation as a complex one ends up
adding an unneeded extra step when pasting over a selection.

This fixes issue #18325

(cherry picked from commit b09e0454bb)
2018-05-13 22:16:56 +02:00
thfrwn 3491e776dd fix clang6 assignment error
(cherry picked from commit f48ff4dc64)
2018-05-13 22:13:14 +02:00
Hein-Pieter van Braam 3ee4d6af2e Hand-merge API hash fixes #18514
This hasn't made it into master yet but is important for mono support.
If this turns out to be the wrong call we'll revert and merge whatever
next version of this becomes available.
2018-04-29 20:44:48 +02:00
sersoong b5425e3d87 Fixed context menu TTR bugs
(cherry picked from commit a1cfc89108)
2018-04-28 22:57:32 +02:00
ShyRed d89015cfe3 ItemList selection: Check against item count
ItemList needs to check against the number of items available when the user moves the selection via "ui_right" action.

(cherry picked from commit cbcb96ae85)
2018-04-28 22:43:36 +02:00
robfram 7f64090401 LineEdit placeholder alignment, content margins, and overflow bugs
LineEdit doesn't correctly uses style margins nor use placeholders
width correctly, causing multiple rendering bugs.

(cherry picked from commit 53b51f68bf)
2018-04-28 22:30:06 +02:00
Pedro J. Estébanez 02f767fe0d Add support for radio-looking items with icon
Letting users of `PopupMenu` use them. `OptionButton` was one of those interested and is updated in this commit.

Fixes #18063.

(cherry picked from commit b964a9e678)
2018-04-28 22:17:08 +02:00
Pedro J. Estébanez 20fa30bde6 Use radio-button-like menu entries where applicable
(cherry picked from commit a6dc160d5c)
2018-04-28 22:16:53 +02:00
Pedro J. Estébanez a525ea128d Add radio-button-looking entries to PopupMenu
They work exactly the same as current checkbox-decorated items, but in order to preserve compatibility, separate methods are used, like `add_radio_check_item()`. The other option would have been to add a new parameter at the end of `add_check_item()` and the like, but that would have forced callers to provide the defaults manually.

`is_item_checkable()`, `is_item_checked()` and `set_item_checked()` are used regardless the item is set to look as check box or radio button.

Keeping check in the name adds an additional clue about these facts.

Closes #13055.

(cherry picked from commit ab3b1d9f3e)
2018-04-28 22:16:25 +02:00
Gilles Roudiere 448d281222 Fixes wrong calculation of gridcontainer's children size
(cherry picked from commit 896e5a64d3)
2018-04-28 17:40:29 +02:00
robfram b855bc44ae Implement line clipping for `TextureProgress` to avoid bad rendering due to imprecise UV mapping
Original code used a quick aproximation for simulating the
correspondent texel in the `TextureProgress` texture as radial
progress indicator. This lead to visualization errors. Changed it for
a Liang-Barsky line clipping algorithm stripped to its minimum for
this specific use case.

Fix #17364.

(cherry picked from commit 7991bd168d)
2018-04-28 16:19:52 +02:00
robfram bffd4f0548 Fix bad autocomplete of partially written node paths when using syntactic sugar notation ($)
If you had a tree like Node2D->Sprite->Camera2D and you write a
code like $Node2D/Spr and chose the autocompletion sugested
Node2D/Sprite, the resulting string was $Node2D/Node2D/Sprite
instead $Node2D/Sprite. If you chose Node2D/Sprite/Camera2D, then
you ended with $Node2D/Node2D/Sprite/Camera2D.

Fix #15813.

(cherry picked from commit 95f186b621)
2018-04-14 23:14:30 +02:00
Alexander Holland 259b9664ef auto-completion edge jump
arrow up/down jumps to end/start on edges

(cherry picked from commit e36dd4282b)
2018-04-14 21:29:48 +02:00
Ruslan Mustakov 710b57d493 Make BaseButton not emit press when container is scrolled
This fixes the problem described in #13996 in a proper way.

This also adds "deadzone" property to ScrollContainer. It can be used
on mobile, where taps are not as precise as mouse clicks. Player could
slightly move their finger when tapping, in which case we still want
the button to be pressed rather than the container to be scrolled.

(cherry picked from commit dcf5be92a3)
2018-04-14 19:36:10 +02:00
Gilles Roudiere b6f30f1b5b Fixes infinite loop in GridContainer
(cherry picked from commit 44cb8eb3a2)
2018-03-29 00:41:03 +02:00
Leon Krause a5ccaa919e Prevent division by zero in GridContainer
(cherry picked from commit 38623e07ac)
2018-03-29 00:12:35 +02:00
bncastle 449e75455b Fix BaseButton not always calling _pressed()
Fix "ui_accept" action in BaseButton.cpp not calling _pressed() func in
GDScript

(cherry picked from commit ceb079fa35)
2018-03-28 23:55:58 +02:00
Gary Oberbrunner 91bc845152 Fix infinite loop in GridContainer layout
I had a grid container and tried to set rect.min_height larger in the
editor; that caused an infinite loop in GridContainer::_notification
at line 118. The reason is max_index was being set to the *height* of
the row, not the *index* of the row. So later when it tried to erase
that row and try again, there was nothing to erase.
I applied the same fix to the width code.

(cherry picked from commit 561e57df13)
2018-03-28 23:45:39 +02:00
JFonS a026e2626c Fix weird editor crash when switching from editing one gradient to another keeps 'grabbing' variable to true
(cherry picked from commit f68594a525)
2018-03-28 22:01:19 +02:00
Bernhard Liebl f967334f53 Fix more regressions in RichTextLabel from PR 15711
(cherry picked from commit 0e1e95c41f)
2018-03-03 01:47:52 +01:00
Hein-Pieter van Braam 675899a521 Fix various valgrind reported uninitialized variable uses
(cherry picked from commit d702d7b335)
2018-03-01 21:06:31 +01:00
poke1024 c800653c6f Fix regression through fa98637aca
(cherry picked from commit 89f607604e)
2018-03-01 19:19:29 +01:00
Rado'sPC\aRaGaR 3d804778fd Fix quotation in string
fix for #16404

(cherry picked from commit f38e819fc1)
2018-02-22 13:23:44 +01:00
Artem Varaksa eacd66e784 Clean up some bad words from code comments
(cherry picked from commit d35e486228)
2018-02-22 12:22:41 +01:00
luz.paz 751806b5c7 Fix typos with codespell
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt`
Whitelist consists of:
```
ang
doubleclick
lod
nd
que
te
unselect
```

(cherry picked from commit 612ab4bbc6)
2018-02-22 12:17:06 +01:00
isaacremnant f01821b60a Force controls to save rect_clip_content since they do not all default to false.
(cherry picked from commit cc902cf9ab)
2018-02-22 00:01:33 +01:00
Bernhard Liebl fa98637aca Fixes wrong vertical font layout in RichTextLabel
(cherry picked from commit 77b1320fb4)
2018-02-21 23:52:49 +01:00
Ian 723613dbc3 TextEdit folding over unindented comments
(cherry picked from commit d327f75392)
2018-02-21 23:51:45 +01:00
Hein-Pieter van Braam 8efb9c8cdd Actually fix the db/dc renaming mess
Local builds save lives :)
2018-02-21 23:21:21 +01:00
Hein-Pieter van Braam 75289b4017 revert the renaming _tree_db_selected function 2018-02-21 22:57:50 +01:00
Michael Alexsander Silva Dias 23b9f09c58 Fixed "Open" button being enabled when nothing is selected in a FileDialog while in "Open folder" mode.
(cherry picked from commit db80d56388)
2018-02-21 22:23:24 +01:00
Max 4383fae5a4 Fixed disappearing text on filedialog buttons
(cherry picked from commit 6a48f952ca)
2018-02-21 22:15:05 +01:00
volzhs 317cb336eb Keep to show current script when closing all docs
also fix error when removing multiple tabs from TabContainer at same frame.
like closing multiple docs at once.

Fix #16403

(cherry picked from commit df84290a7e)
2018-02-21 22:09:23 +01:00
Alexander Alekseev 18735ff6f2 Fixes OptionButton selection index being reset to zero at instanciation
Bug: engine tries to set selected item before items were added during save scene/run project, because of wrong properties order.
Fixes #10213.

(cherry picked from commit 66c39b1426)
2018-02-19 22:29:36 +01:00