Skip to content

Commit 09bc1ca

Browse files
committed
Merge pull request godotengine#77292 from Calinou/project-manager-add-select-all-none-shortcuts
Add Ctrl + A and Ctrl + Shift + A to (de)select all projects in project manager
2 parents b0a03ed + 226d726 commit 09bc1ca

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

editor/project_manager/project_list.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,22 @@ void ProjectList::select_first_visible_project() {
13071307
}
13081308
}
13091309

1310+
void ProjectList::deselect_all_visible_projects() {
1311+
for (int i = 0; i < _projects.size(); i++) {
1312+
if (_projects[i].control->is_visible()) {
1313+
_deselect_project_nocheck(i);
1314+
}
1315+
}
1316+
}
1317+
1318+
void ProjectList::select_all_visible_projects() {
1319+
for (int i = 0; i < _projects.size(); i++) {
1320+
if (_projects[i].control->is_visible()) {
1321+
_select_project_nocheck(i);
1322+
}
1323+
}
1324+
}
1325+
13101326
Vector<ProjectList::Item> ProjectList::get_selected_projects() const {
13111327
Vector<Item> items;
13121328
if (_selected_project_paths.is_empty()) {

editor/project_manager/project_list.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ class ProjectList : public ScrollContainer {
309309
void select_project(int p_index);
310310
void deselect_project(int p_index);
311311
void select_first_visible_project();
312+
void select_all_visible_projects();
313+
void deselect_all_visible_projects();
312314
Vector<Item> get_selected_projects() const;
313315
const HashSet<String> &get_selected_project_keys() const;
314316
int get_single_selected_index() const;

editor/project_manager/project_manager.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,16 @@ void ProjectManager::shortcut_input(const Ref<InputEvent> &p_ev) {
12481248
keycode_handled = false;
12491249
}
12501250
} break;
1251+
case Key::A: {
1252+
if (k->is_command_or_control_pressed()) {
1253+
if (k->is_shift_pressed()) {
1254+
project_list->deselect_all_visible_projects();
1255+
} else {
1256+
project_list->select_all_visible_projects();
1257+
}
1258+
_update_project_buttons();
1259+
}
1260+
} break;
12511261
default: {
12521262
keycode_handled = false;
12531263
} break;

0 commit comments

Comments
 (0)