summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-25 11:05:37 +0200
committerGitHub <noreply@github.com>2018-08-25 11:05:37 +0200
commit4a5579bf78e750a75f19e7701e3246208c5d1645 (patch)
treed0dddf1434bee16dd8839ee52dbef91af227325f
parent19af8a59993b4edf7d23d564d0d7fe3064a39ce4 (diff)
parent7aca4c32e2d3051b4d58adafe401da2e97f77c44 (diff)
Merge pull request #21358 from MidZik/master
Disable ability to copy or cut text from LineEdit if secret mode is enabled.
-rw-r--r--scene/gui/line_edit.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 549daecdae..1f3d5e6e13 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -866,15 +866,14 @@ void LineEdit::_notification(int p_what) {
void LineEdit::copy_text() {
- if (selection.enabled) {
-
+ if (selection.enabled && !pass) {
OS::get_singleton()->set_clipboard(text.substr(selection.begin, selection.end - selection.begin));
}
}
void LineEdit::cut_text() {
- if (selection.enabled) {
+ if (selection.enabled && !pass) {
OS::get_singleton()->set_clipboard(text.substr(selection.begin, selection.end - selection.begin));
selection_delete();
}