瀏覽代碼

Disable ability to copy or cut text from LineEdit if secret mode is enabled.

MidZik 7 年之前
父節點
當前提交
7aca4c32e2
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      scene/gui/line_edit.cpp

+ 2 - 3
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();
 	}