diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-20 16:26:32 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-20 16:26:32 +0200 |
commit | 77f779d326e56bde89f11aa12be692ff4c4fb489 (patch) | |
tree | 34e5f492fd165b30c39d8c816de4960aa76ee6ae | |
parent | 8738aae9fc5e5f8193ec980e329486bfb2d26355 (diff) | |
parent | f7a7ecc10ae6f8f0590651d836e1169c6034087f (diff) | |
download | redot-engine-77f779d326e56bde89f11aa12be692ff4c4fb489.tar.gz |
Merge pull request #97167 from MewPurPur/reveal-undoredo
Expose `has_undo()` and `has_redo()` of LineEdit
-rw-r--r-- | doc/classes/LineEdit.xml | 12 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index d218f720a3..9c460e6d62 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -151,12 +151,24 @@ Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME). </description> </method> + <method name="has_redo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if a "redo" action is available. + </description> + </method> <method name="has_selection" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the user has selected text. </description> </method> + <method name="has_undo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if an "undo" action is available. + </description> + </method> <method name="insert_text_at_caret"> <return type="void" /> <param index="0" name="text" type="String" /> diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index ae709cf7a4..43782409a8 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -2764,6 +2764,8 @@ void LineEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("select", "from", "to"), &LineEdit::select, DEFVAL(0), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("select_all"), &LineEdit::select_all); ClassDB::bind_method(D_METHOD("deselect"), &LineEdit::deselect); + ClassDB::bind_method(D_METHOD("has_undo"), &LineEdit::has_undo); + ClassDB::bind_method(D_METHOD("has_redo"), &LineEdit::has_redo); ClassDB::bind_method(D_METHOD("has_selection"), &LineEdit::has_selection); ClassDB::bind_method(D_METHOD("get_selected_text"), &LineEdit::get_selected_text); ClassDB::bind_method(D_METHOD("get_selection_from_column"), &LineEdit::get_selection_from_column); |