1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Improve Undo/Redo menu items

* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
This commit is contained in:
Haoyu Qiu
2021-08-17 11:41:46 +08:00
parent ca6c5cf7e6
commit 16c2d4ef22
13 changed files with 94 additions and 12 deletions

View File

@@ -405,11 +405,11 @@ String UndoRedo::get_current_action_name() const {
return actions[current_action].name;
}
bool UndoRedo::has_undo() {
bool UndoRedo::has_undo() const {
return current_action >= 0;
}
bool UndoRedo::has_redo() {
bool UndoRedo::has_redo() const {
return (current_action + 1) < actions.size();
}