summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-17 19:09:56 +0200
committerGitHub <noreply@github.com>2021-08-17 19:09:56 +0200
commit273d1ca9329aaa849e18f4d3a1f3f461d54dbb41 (patch)
tree2cd6f932eafd4e493f9f9bcc092ca49106e2507b /core/object
parent6cea7ebae4721e05ea7013c6159a751f7498ea85 (diff)
parent16c2d4ef22a2928489934833bab06d5ea33bd90e (diff)
Merge pull request #51775 from timothyqiu/disable-undo-redo
Improve Undo/Redo menu items
Diffstat (limited to 'core/object')
-rw-r--r--core/object/undo_redo.cpp4
-rw-r--r--core/object/undo_redo.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp
index adf068eb2f..b7d2bac96d 100644
--- a/core/object/undo_redo.cpp
+++ b/core/object/undo_redo.cpp
@@ -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();
}
diff --git a/core/object/undo_redo.h b/core/object/undo_redo.h
index 8f009830e3..d1ce252d86 100644
--- a/core/object/undo_redo.h
+++ b/core/object/undo_redo.h
@@ -121,8 +121,8 @@ public:
String get_action_name(int p_id);
void clear_history(bool p_increase_version = true);
- bool has_undo();
- bool has_redo();
+ bool has_undo() const;
+ bool has_redo() const;
uint64_t get_version() const;