* 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.
* LineEdit popups created on demand.
* TextEdit popups created on demand.
* SpinSlider popups created on demand.
* ResourcePicker popups created on demand.
Improves editor responsiveness.
When appending text (either via `set_text()` or by pasting from clipboard),
if the input would make the `LineEdit` exceed its configured `max_length`,
the input text is truncated to fit. The discard part is passed as a parameter
in the `text_change_rejected` signal.
Fixes#33321.
Fixes#41278.
Also cleaned up unimplemented `max_chars` property in `TextEdit`.
Co-authored-by: Tony-Goat <70238376+Tony-Goat@users.noreply.github.com>
This also acts as a general-purpose "deselect" shortcut since pressing
it a second time will deselect text.
This is available both in the script editor and in TextEdit fields
in use, both in the editor and projects.
The Duplicate Line script editor shortcut was moved to Ctrl + Shift + D
since it conflicts with the new shortcut (Ctrl + D). The rationale for
doing so is that Duplicate Line is a less commonly used action, and
its behavior can be replicated by copying and pasting the current line
anyway. (With no selection active, the whole line will be copied.)
This removes hardcoded actions from things like LineEdit and TextEdit.
Previously, things like copy, paste, etc were all hardcoded to Ctrl+C, Ctrl+V, etc. They could not be changed. This allows the possibility of them being changed, by making them use the action map. This has the added benefit of greatly simplifying the input handling logic in those controls. The logic which was previously in a huge and hard to follow switch statement has been extracted to individual methods.
Now TextEdit adjusts x & y offset according to the corresponding
StyleBox when in normal or read-only mode.
In order to handle bottom content margin, wrapped lines that are entirely outside the stylebox content area are not drawn.