From 0e01961c66a493cb84786c3098a26c71a2c415cf Mon Sep 17 00:00:00 2001 From: spx Date: Sun, 12 Aug 2012 21:59:07 -0700 Subject: [PATCH] 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 --- Library/MeterWindow.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 937eb9a3..be78d260 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -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 // variables for nonexistent measures/meters. for (auto iter = m_Meters.cbegin(); iter != m_Meters.cend(); ++iter) @@ -2193,12 +2200,13 @@ bool CMeterWindow::ReadSkin() 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()); - Rainmeter->ShowMessage(m_Window, text.c_str(), MB_OK | MB_ICONEXCLAMATION); - return false; + bool bActiveTransition = true; // Do not track the change of ActiveTransition + UpdateMeter(*iter, bActiveTransition, true); } + ResizeWindow(true); return true; }