Fixed that #CURRENTCONFIGWIDTH# and #CURRENTCONFIGHEIGHT# don't work in some cases. Partially reverted 638b467.

http://rainmeter.net/forum/viewtopic.php?f=103&t=11698&start=10#p74334
This commit is contained in:
spx 2012-08-12 21:59:07 -07:00
parent 2cbdb2b9f2
commit 0e01961c66

View File

@ -2170,6 +2170,13 @@ bool CMeterWindow::ReadSkin()
} }
} }
if (m_Meters.empty())
{
std::wstring text = GetFormattedString(ID_STR_NOMETERSINSKIN, m_FolderPath.c_str(), m_FileName.c_str());
Rainmeter->ShowMessage(m_Window, text.c_str(), MB_OK | MB_ICONEXCLAMATION);
return false;
}
// Initialize meters. Separate loop to avoid errors caused with section // Initialize meters. Separate loop to avoid errors caused with section
// variables for nonexistent measures/meters. // variables for nonexistent measures/meters.
for (auto iter = m_Meters.cbegin(); iter != m_Meters.cend(); ++iter) for (auto iter = m_Meters.cbegin(); iter != m_Meters.cend(); ++iter)
@ -2193,12 +2200,13 @@ bool CMeterWindow::ReadSkin()
measure->Initialize(); measure->Initialize();
} }
if (m_Meters.empty()) // Set window size (and CURRENTCONFIGWIDTH/HEIGHT) temporarily
for (auto iter = m_Meters.cbegin(); iter != m_Meters.cend(); ++iter)
{ {
std::wstring text = GetFormattedString(ID_STR_NOMETERSINSKIN, m_FolderPath.c_str(), m_FileName.c_str()); bool bActiveTransition = true; // Do not track the change of ActiveTransition
Rainmeter->ShowMessage(m_Window, text.c_str(), MB_OK | MB_ICONEXCLAMATION); UpdateMeter(*iter, bActiveTransition, true);
return false;
} }
ResizeWindow(true);
return true; return true;
} }