1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

Add Ctrl + A and Ctrl + Shift + A to (de)select all projects in project manager

These keyboard shortcuts are commonly used in applications to (de)select
all entries in a list.
This commit is contained in:
Hugo Locurcio
2024-10-17 17:36:00 +02:00
parent e6aa06d3de
commit 226d726b05
3 changed files with 28 additions and 0 deletions

View File

@@ -1176,6 +1176,22 @@ void ProjectList::select_first_visible_project() {
}
}
void ProjectList::deselect_all_visible_projects() {
for (int i = 0; i < _projects.size(); i++) {
if (_projects[i].control->is_visible()) {
_deselect_project_nocheck(i);
}
}
}
void ProjectList::select_all_visible_projects() {
for (int i = 0; i < _projects.size(); i++) {
if (_projects[i].control->is_visible()) {
_select_project_nocheck(i);
}
}
}
Vector<ProjectList::Item> ProjectList::get_selected_projects() const {
Vector<Item> items;
if (_selected_project_paths.is_empty()) {