From b64ae8050263c4b5a0d47b017c757fc981b0b4ec Mon Sep 17 00:00:00 2001 From: Bruce Date: Sat, 22 Feb 2025 23:20:01 +0800 Subject: [PATCH] Fixed Store Logo Display. --- AppInstaller/mainwnd.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/AppInstaller/mainwnd.cpp b/AppInstaller/mainwnd.cpp index 5530f11..ea9702d 100644 --- a/AppInstaller/mainwnd.cpp +++ b/AppInstaller/mainwnd.cpp @@ -827,17 +827,22 @@ public ref class MainWnd: public Form setTextJS ("button-serial-1", rcString (BUTTON_5_SER1)); } setPageJS (serial); + setPicBoxVisibilityJS (false); if (serial > 1) { std::string res = m_pkgInfo.getPropertyLogoBase64 (); - if (!res.empty () && res.length () > 0) + if (m_pkgInfo.getPropertyLogoIStream () && !res.empty () && res.length () > 10) { std::string b64logo = res; // MessageBox::Show (gcnew String ((std::string ("Base 64 String: ") + b64logo).c_str ())); this->setStoreLogoJS (gcnew String (res.c_str ())); setPicBoxVisibilityJS (true); } - else setPicBoxVisibilityJS (false); + else + { + this->setStoreLogoJS ("./Libs/Images/StoreLogo.png"); + setPicBoxVisibilityJS (false); + } } else { @@ -867,6 +872,17 @@ public ref class MainWnd: public Form setLogoBackgroundColorJS (color); } } + void invokeSetColor (System::Drawing::Color ^color) + { + if (this->InvokeRequired) + { + this->Invoke (gcnew Action (this, &MainWnd::setLogoBackgroundColorJS), ColorToHtml (*color)); + } + else + { + setLogoBackgroundColorJS (color); + } + } void setTaskbarProgress (int progress) { IntPtr hwnd = this->Handle; @@ -919,8 +935,10 @@ public ref class MainWnd: public Form // if (page < 0) invokeSetPage (2); if (color.size () > 0) { + if (LabelEqual (color [0].c_str (), L"transparent")) invokeSetColor (GetAeroColor ()); invokeSetColor (gcnew String (color [0].c_str ())); } + else invokeSetColor (GetAeroColor ()); invokeSetPage (2); if (m_silentMode) {