summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorDmitryKrutskikh <dmitry.krutskikh@gmail.com>2018-05-09 09:28:01 +0300
committerDmitryKrutskikh <dmitry.krutskikh@gmail.com>2018-05-09 19:13:53 +0300
commit965b6ac2736dd7bac8686cd447f0e9430e020349 (patch)
tree34de3dbd9c513af1148f038516df1cf7f8794ed7 /editor
parent0f930f831410bc57d0e975b4ab73715d0d034735 (diff)
Disable 'run' button if any project not selected and tiny refactoring
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 666f08cb2d..97d3a070ab 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -725,9 +725,11 @@ void ProjectManager::_update_project_buttons() {
}
}
- 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<InputEvent> &p_ev, Node *p_hb) {