Commit graph

102 commits

Author SHA1 Message Date
kobewi
263a2bdec6 Rework FileDialog shortcuts 2025-10-11 14:37:40 +02:00
Lukas Tenbrink
1db0a60dc0 Replace std::size usage with std_size to avoid <iterator> include. 2025-10-05 00:26:11 +02:00
kobewi
d61a337a70 Improve usage of String.split() vs get_slice() 2025-09-19 16:31:55 +02:00
Talkashie
bc7e68dfd1 Typos 2025-08-19 18:32:59 -05:00
Hugo Locurcio
b4477f3f49
Fix action name for ui_colorpicker_delete_preset in built-in InputMap
The old action name is a leftover from a now-reverted PR.
2025-06-13 02:24:34 +02:00
Haoyu Qiu
fa7efd94b3 Fix mixed use of spaces and tabs for indentation 2025-06-07 00:30:26 +08:00
kobewi
c32a031908 Improve auto-translation of Script Editor 2025-06-04 14:41:15 +02:00
Yufeng Ying
55a61cbd4a Optimize InputMap::get_actions. 2025-05-12 17:51:27 +08:00
kobewi
5af4bef46f Inline static variables (part 1) 2025-04-29 18:10:44 +02:00
Pāvels Nadtočajevs
b106dfd4f9
Base accessibility API. 2025-04-08 20:14:28 +03:00
Konrad Gadzina
e6f812c056 Modify color in ColorPicker with keyboard or joypad 2025-03-11 22:41:41 +01:00
Adam Scott
1d325847f3
Revert "Add built-in GUI to display license notices"
This reverts commit daa6198925.
2025-03-10 10:33:12 -04:00
Thaddeus Crews
3c43508ed7
Merge pull request #102427 from AThousandShips/fix_substr
Clean up some uses of `String::substr`
2025-03-07 15:12:33 -06:00
Thaddeus Crews
0c6efe572e
Merge pull request #79599 from Calinou/add-license-notices-gui
Add built-in GUI to display license notices
2025-03-07 15:12:29 -06:00
A Thousand Ships
5113022dfe
Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
Lukas Tenbrink
e34f1f504c Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase. 2025-02-07 14:57:48 +01:00
Hugo Locurcio
daa6198925 Add built-in GUI to display license notices
Press Ctrl/Cmd + Shift + L (`ui_toggle_licenses_dialog` built-in action)
to show/hide the notices dialog.

The dialog can be shown via script using
`SceneTree.licenses_dialog_visible = true|false`.

Co-authored-by: MewPurPur <mew.pur.pur@abv.bg>
2025-01-27 18:35:04 +01:00
Rémi Verschelde
be4678b836
Merge pull request #95750 from mosquitochang/fix-input-event-get-index
Fix `InputMap::event_get_index` to handle unmatched events correctly
2025-01-06 22:46:37 +01:00
Thaddeus Crews
3c304ab7cc
Merge pull request #96076 from AThousandShips/improve_null_check_core_drivers
[Core,Drivers] Improve use of `Ref.is_null/valid`
2024-12-23 11:14:58 -06:00
Thaddeus Crews
8b5f181d86
Merge pull request #90723 from Calinou/textedit-autocompletion-always-replace-if-not-shift
Make TextEdit autocompletion replace word unless Shift is held
2024-11-27 10:47:24 -06:00
Markus Sauermann
bc5e2f9b96 Revert "Fix InputEvent device id clash" and add a compatibility function
This reverts commit 916d480686.

Revert "Fix InputEvent crash when opening project"
This reverts commit abb9c0f171.

Introduce a compatibility function for projects affected by the
device id clash reversal

Since the reverted PR introduced changes in the project.godot
file, it seems prudent to introduce a compatibility function for
such affected projects.
2024-11-20 09:18:55 +01:00
A Thousand Ships
68f638cf02
Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
Malcolm Anderson
829dade53b Replace default deadzone magic number with named constant 2024-11-12 10:11:52 -08:00
A Thousand Ships
ec650a2f09
[Core,Drivers] Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-11-01 16:50:11 +01:00
A Thousand Ships
38f9769bc6
[Core] Improve error messages with vformat 2024-10-30 15:55:51 +01:00
Thaddeus Crews
ecc2eb73fc
Merge pull request #97707 from Sauermann/fix-input-device-clash
Fix `InputEvent` device id clash
2024-10-21 16:39:10 -05:00
Markus Sauermann
916d480686 Fix InputEvent device id clash
`InputMap::ALL_DEVICES` and `InputEvent::DEVICE_ID_EMULATION` have the
same value `-1`.

Change value of `InputMap::All_DEVICES` so that it's different from
`InputEvent::DEVICE_ID_EMULATION`. `InputEvent::DEVICE_ID_EMULATION`
is part of the API and can't be changed without potentially breaking
projects.

Gather all special device constants in a single location inside
`InputEvent`.

Add a converter to project settings, that takes care of adjusting
project files during loading.
2024-10-20 21:56:41 +02:00
Roman Morozov
d532eecc81 Changed the default deadzone value for new actions from 0.5 to 0.2 2024-10-01 16:47:44 +04:00
bruvzg
b776f55bcb
Add Control+Shift+U (rebindabe) action for Unicode input, show hex as it is entered. 2024-09-12 11:47:24 +03:00
mosquito chang
b32395ade9 Fix InputMap::event_get_index to handle unmatched events correctly 2024-08-18 14:46:34 +02:00
Mikael Hermansson
085f0cc50a Add Home/End to text caret movements on macOS 2024-07-08 16:08:27 +02:00
kobewi
17d3f26e5d Add event_index to InputEventAction 2024-05-30 12:51:15 +02:00
Hugo Locurcio
9558d4f28f
Make TextEdit autocompletion replace word unless Shift is held
This makes Tab and Enter act identical by default for autocompletion.

If Shift is held, the suggestion is added in-place without the word
being replaced. This matches the behavior found in Visual Studio Code
where the following occurs:

- Pressing Tab accepts the suggestion and replaces the word.
- Pressing Enter accepts the suggestion and replaces the word.
- Pressing Shift + Tab accepts the suggestion and doesn't replace the word.
- Pressing Shift + Enter accepts the suggestion and doesn't replace the word.
2024-04-16 00:21:14 +02:00
Christophe Andral
c988bec4b3 Add 'Skip to next (text) occurrence' feature to text editor
Adds `ui_text_skip_selection_for_next_occurrence` action and related implementation to text editor.
This action is bound `Ctrl+Alt+D` shorcut.

Used in conjonction with `ui_add_skip_selection_for_next_occurrence`, it gives the user the ability to select many occurrences of a selection
and avoid some of them.
Used without a previous selection, the action jumps to the next occurrence of the current word under the caret.
2024-03-25 11:12:28 +01:00
Micky
70b428041b Add autocompletion for InputMap's methods 2024-03-01 16:44:26 +01:00
Wilson E. Alvarez
a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
kobewi
d9d0cfaf38 Rework input actions to be reliable 2023-11-10 15:24:04 +01: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
bruvzg
b3c64675cc
[macOS] Replace all Alt/Option+Letter/Number default shortcuts to avoid conflicts with special character input. 2023-02-20 22:02:47 +02:00
Haoyu Qiu
84aee17901 Improvements and fixes based on Weblate comments
* Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted".
* Spell out "Animation" instead of using "Anim.".
* Treat "Max" as regular word instead of writing "Max.".
* Use generic "Set %s" for action name instead of a dedicated "Set target_position".
* Add translator comment for:
    * "Inclusive" and "Self" in the profiler.
    * Places where it needs the context about being an editor progress label.
    * "Duplicated Animation Name" since it's refering to the new name of a duplicated animation.
    * Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal".
* Fix wrong undo action name for renaming an input action.
* Fix missing end quote in a shader error message.
* In class reference:
    * Fix duplicated "if" in the description of `signf()`.
    * Fix mismatched example output in `String.operator %()`.
    * Fix typo in the description of `Decal.texture_emission`.
    * Unify description of `String.match()` and `StringName.match()`.
2023-02-13 15:22:18 +08:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +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
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
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
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
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
PucklaMotzer09
e5354cacd0 Add Caret Insert Below and Above shortcuts to TextEdit 2022-10-18 10:38:53 +02:00
bruvzg
6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +02:00
kobewi
1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00