- SetOption: Fixed that new image isn't loaded if DynamicVariables=0.

- SetOption: Fixed that Rainmeter crashes if !SetOption is executed to Measure=Plugin.
- Code cleanup and cosmetic changes.
This commit is contained in:
spx
2011-07-27 14:18:02 +00:00
parent a76e8d1765
commit fb004083d2
6 changed files with 34 additions and 21 deletions

View File

@ -33,7 +33,7 @@ using namespace Gdiplus;
**
*/
CMeterImage::CMeterImage(CMeterWindow* meterWindow, const WCHAR* name) : CMeter(meterWindow, name),
m_NeedsReload(false),
m_NeedsRedraw(false),
m_WidthDefined(false),
m_HeightDefined(false),
m_PreserveAspectRatio(false),
@ -157,6 +157,13 @@ void CMeterImage::ReadConfig(CConfigParser& parser, const WCHAR* section)
// Read tinting configs
m_Image.ReadConfig(parser, section);
if (m_Initialized &&
!m_Measure && !m_DynamicVariables)
{
Initialize();
m_NeedsRedraw = true;
}
}
/*
@ -216,6 +223,11 @@ bool CMeterImage::Update()
LoadImage(m_ImageNameResult, oldResult != m_ImageNameResult);
return true;
}
else if (m_NeedsRedraw)
{
m_NeedsRedraw = false;
return true;
}
}
return false;
}