[macOS] Add support for exporting macOS 26 Liquid Glass icons.

This commit is contained in:
Pāvels Nadtočajevs 2025-07-20 13:50:51 +03:00
parent 8b2739ee55
commit 838cb0eefc
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
11 changed files with 132 additions and 5 deletions

View file

@ -4533,8 +4533,13 @@ int Main::start() {
sml->add_current_scene(scene);
#ifdef MACOS_ENABLED
#ifndef TOOLS_ENABLED
if ((FileAccess::exists(OS::get_singleton()->get_bundle_resource_dir().path_join("Assets.car")) && !OS::get_singleton()->get_bundle_icon_name().is_empty()) || (!OS::get_singleton()->get_bundle_icon_path().is_empty())) {
has_icon = true; // Bundle has embedded icon, do not override with project icon.
}
#endif
String mac_icon_path = GLOBAL_GET("application/config/macos_native_icon");
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_ICON) && !mac_icon_path.is_empty()) {
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_ICON) && !mac_icon_path.is_empty() && !has_icon) {
DisplayServer::get_singleton()->set_native_icon(mac_icon_path);
has_icon = true;
}