summaryrefslogtreecommitdiffstats
path: root/editor/project_manager
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-01-19 19:41:01 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-03-04 23:41:41 +0200
commitc65a6679248476f554a0876ac32618b580beb010 (patch)
treea0e7937dcde18acb8e4178b29df0cedbd92905a4 /editor/project_manager
parenta07dd0d6a520723c4838fb4b65461a16b7a50f90 (diff)
downloadredot-engine-c65a6679248476f554a0876ac32618b580beb010.tar.gz
Move `global_menu_*` methods to a separate `NativeMenu` class.
Diffstat (limited to 'editor/project_manager')
-rw-r--r--editor/project_manager/project_list.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp
index 234390c136..aa93d9414b 100644
--- a/editor/project_manager/project_list.cpp
+++ b/editor/project_manager/project_list.cpp
@@ -1012,10 +1012,11 @@ void ProjectList::set_order_option(int p_option) {
// Global menu integration.
void ProjectList::update_dock_menu() {
- if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) {
+ if (!NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU)) {
return;
}
- DisplayServer::get_singleton()->global_menu_clear("_dock");
+ RID dock_rid = NativeMenu::get_singleton()->get_system_menu(NativeMenu::DOCK_MENU_ID);
+ NativeMenu::get_singleton()->clear(dock_rid);
int favs_added = 0;
int total_added = 0;
@@ -1025,18 +1026,18 @@ void ProjectList::update_dock_menu() {
favs_added++;
} else {
if (favs_added != 0) {
- DisplayServer::get_singleton()->global_menu_add_separator("_dock");
+ NativeMenu::get_singleton()->add_separator(dock_rid);
}
favs_added = 0;
}
- DisplayServer::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", callable_mp(this, &ProjectList::_global_menu_open_project), Callable(), i);
+ NativeMenu::get_singleton()->add_item(dock_rid, _projects[i].project_name + " ( " + _projects[i].path + " )", callable_mp(this, &ProjectList::_global_menu_open_project), Callable(), i);
total_added++;
}
}
if (total_added != 0) {
- DisplayServer::get_singleton()->global_menu_add_separator("_dock");
+ NativeMenu::get_singleton()->add_separator(dock_rid);
}
- DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), callable_mp(this, &ProjectList::_global_menu_new_window));
+ NativeMenu::get_singleton()->add_item(dock_rid, TTR("New Window"), callable_mp(this, &ProjectList::_global_menu_new_window));
}
void ProjectList::_global_menu_new_window(const Variant &p_tag) {