Fixed Store Logo Display.

This commit is contained in:
Bruce
2025-02-22 23:20:01 +08:00
parent c111210987
commit b64ae80502

View File

@@ -827,17 +827,22 @@ public ref class MainWnd: public Form
setTextJS ("button-serial-1", rcString (BUTTON_5_SER1)); setTextJS ("button-serial-1", rcString (BUTTON_5_SER1));
} }
setPageJS (serial); setPageJS (serial);
setPicBoxVisibilityJS (false);
if (serial > 1) if (serial > 1)
{ {
std::string res = m_pkgInfo.getPropertyLogoBase64 (); 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; std::string b64logo = res;
// MessageBox::Show (gcnew String ((std::string ("Base 64 String: ") + b64logo).c_str ())); // MessageBox::Show (gcnew String ((std::string ("Base 64 String: ") + b64logo).c_str ()));
this->setStoreLogoJS (gcnew String (res.c_str ())); this->setStoreLogoJS (gcnew String (res.c_str ()));
setPicBoxVisibilityJS (true); setPicBoxVisibilityJS (true);
} }
else setPicBoxVisibilityJS (false); else
{
this->setStoreLogoJS ("./Libs/Images/StoreLogo.png");
setPicBoxVisibilityJS (false);
}
} }
else else
{ {
@@ -867,6 +872,17 @@ public ref class MainWnd: public Form
setLogoBackgroundColorJS (color); setLogoBackgroundColorJS (color);
} }
} }
void invokeSetColor (System::Drawing::Color ^color)
{
if (this->InvokeRequired)
{
this->Invoke (gcnew Action <String ^> (this, &MainWnd::setLogoBackgroundColorJS), ColorToHtml (*color));
}
else
{
setLogoBackgroundColorJS (color);
}
}
void setTaskbarProgress (int progress) void setTaskbarProgress (int progress)
{ {
IntPtr hwnd = this->Handle; IntPtr hwnd = this->Handle;
@@ -919,8 +935,10 @@ public ref class MainWnd: public Form
// if (page < 0) invokeSetPage (2); // if (page < 0) invokeSetPage (2);
if (color.size () > 0) if (color.size () > 0)
{ {
if (LabelEqual (color [0].c_str (), L"transparent")) invokeSetColor (GetAeroColor ());
invokeSetColor (gcnew String (color [0].c_str ())); invokeSetColor (gcnew String (color [0].c_str ()));
} }
else invokeSetColor (GetAeroColor ());
invokeSetPage (2); invokeSetPage (2);
if (m_silentMode) if (m_silentMode)
{ {