summaryrefslogtreecommitdiff
path: root/editor/project_settings_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/project_settings_editor.cpp')
-rw-r--r--editor/project_settings_editor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 06befe8f3c..9625bc19c0 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "project_settings_editor.h"
#include "core/global_constants.h"
@@ -749,7 +750,16 @@ void ProjectSettingsEditor::_item_add() {
String catname = category->get_text().strip_edges();
String propname = property->get_text().strip_edges();
- String name = catname != "" ? catname + "/" + propname : propname;
+
+ if (propname.empty()) {
+ return;
+ }
+
+ if (catname.empty()) {
+ catname = "global";
+ }
+
+ String name = catname + "/" + propname;
undo_redo->create_action(TTR("Add Global Property"));
@@ -1585,7 +1595,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
props_base->add_child(hbc);
- search_button = memnew(ToolButton);
+ search_button = memnew(Button);
search_button->set_toggle_mode(true);
search_button->set_pressed(false);
search_button->set_text(TTR("Search"));