浏览代码

Merge pull request #3074 from neikeq/editor_layouts_patch

Editor layout dialog: name field grabs focus on popup
Rémi Verschelde 9 年之前
父节点
当前提交
bfaa179e70
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 7 1
      tools/editor/editor_layout_dialog.cpp
  2. 1 0
      tools/editor/editor_layout_dialog.h

+ 7 - 1
tools/editor/editor_layout_dialog.cpp

@@ -1,5 +1,5 @@
 /*************************************************************************/
 /*************************************************************************/
-/*  editor_node.cpp                                                      */
+/*  editor_layout_dialog.cpp                                             */
 /*************************************************************************/
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
 /*                           GODOT ENGINE                                */
@@ -35,6 +35,12 @@ void EditorLayoutDialog::clear_layout_name() {
 	layout_name->clear();
 	layout_name->clear();
 }
 }
 
 
+void EditorLayoutDialog::_post_popup() {
+
+	ConfirmationDialog::_post_popup();
+	layout_name->grab_focus();
+}
+
 void EditorLayoutDialog::ok_pressed() {
 void EditorLayoutDialog::ok_pressed() {
 
 
 	if (layout_name->get_text()!="") {
 	if (layout_name->get_text()!="") {

+ 1 - 0
tools/editor/editor_layout_dialog.h

@@ -43,6 +43,7 @@ protected:
 
 
 	static void _bind_methods();
 	static void _bind_methods();
 	virtual void ok_pressed();
 	virtual void ok_pressed();
+	virtual void _post_popup();
 
 
 public:
 public:
 	void clear_layout_name();
 	void clear_layout_name();