From a519dcd57653c8ce21dbb823c9c363c28ef447d5 Mon Sep 17 00:00:00 2001 From: DmitryKrutskikh Date: Wed, 9 May 2018 09:28:01 +0300 Subject: [PATCH] Disable 'run' button if any project not selected and tiny refactoring (cherry picked from commit 965b6ac2736dd7bac8686cd447f0e9430e020349) --- editor/project_manager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 6a78c83310f..b2faa5694d6 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -717,9 +717,11 @@ void ProjectManager::_update_project_buttons() { item->update(); } - erase_btn->set_disabled(selected_list.size() < 1); - open_btn->set_disabled(selected_list.size() < 1); - rename_btn->set_disabled(selected_list.size() < 1); + bool empty_selection = selected_list.empty(); + erase_btn->set_disabled(empty_selection); + open_btn->set_disabled(empty_selection); + rename_btn->set_disabled(empty_selection); + run_btn->set_disabled(empty_selection); } void ProjectManager::_panel_input(const Ref &p_ev, Node *p_hb) {