diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-21 10:30:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 10:30:36 +0200 |
commit | ffec7cf193b72dd54b05acfd09b1dee3defcce48 (patch) | |
tree | 5ab3b6923047517aedfda43396c8985e9a9dc05f /main | |
parent | e8a0c5da77bc9d8a1944f5f368d7c414a6c0624a (diff) | |
parent | 092509cbaddb069998ff2dd266bb7933e9009d99 (diff) |
Merge pull request #11299 from marcelofg55/fix_seticon_default
Fix setting the default icon briefly with tools=no
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 04375666a9..1f7418ba2a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -990,8 +990,10 @@ Error Main::setup2(Thread::ID p_main_tid_override) { #endif } +#ifdef TOOLS_ENABLED Ref<Image> icon = memnew(Image(app_icon_png)); OS::get_singleton()->set_icon(icon); +#endif } MAIN_PRINT("Main: DCC"); @@ -1082,6 +1084,7 @@ bool Main::start() { ERR_FAIL_COND_V(!_start_success, false); + bool hasicon = false; bool editor = false; String doc_tool; List<String> removal_docs; @@ -1519,8 +1522,10 @@ bool Main::start() { if (iconpath != "") { Ref<Image> icon; icon.instance(); - if (icon->load(iconpath) == OK) + if (icon->load(iconpath) == OK) { OS::get_singleton()->set_icon(icon); + hasicon = true; + } } } } @@ -1537,6 +1542,11 @@ bool Main::start() { #endif } + if (!hasicon) { + Ref<Image> icon = memnew(Image(app_icon_png)); + OS::get_singleton()->set_icon(icon); + } + OS::get_singleton()->set_main_loop(main_loop); return true; |