From 6eafb835add6b0aca79bde675ebfae3ac858dec2 Mon Sep 17 00:00:00 2001 From: spx Date: Sun, 8 Jun 2014 22:12:15 +0900 Subject: [PATCH] Revert 2152117 http://rainmeter.net/forum/viewtopic.php?f=5&t=18580 --- Library/MeterWindow.cpp | 22 ++++++++++++---------- Library/MeterWindow.h | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 50d60145..a44b3411 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1945,14 +1945,7 @@ void MeterWindow::ReadOptions() m_FadeDuration = parser.ReadInt(section, L"FadeDuration", 250); - std::wstring skinGroup = parser.ReadString(section, L"Group", L""); - const std::wstring& group = m_Parser.ReadString(L"Rainmeter", L"Group", L""); - if (!group.empty()) - { - skinGroup += L'|'; - skinGroup += group; - } - InitializeGroup(skinGroup); + m_SkinGroup = parser.ReadString(section, L"Group", L""); if (writeFlags != 0) { @@ -2077,11 +2070,11 @@ bool MeterWindow::ReadSkin() std::wstring resourcePath = GetResourcesPath(); bool hasResourcesFolder = (_waccess(resourcePath.c_str(), 0) == 0); - m_Parser.Initialize(iniFile, this, nullptr, &resourcePath); - // Read options from Rainmeter.ini. ReadOptions(); + m_Parser.Initialize(iniFile, this, nullptr, &resourcePath); + m_Canvas = Gfx::Canvas::Create( m_UseD2D && GetRainmeter().GetUseD2D() ? Gfx::Renderer::PreferD2D : Gfx::Renderer::GDIP); m_Canvas->SetAccurateText(m_Parser.ReadBool(L"Rainmeter", L"AccurateText", false)); @@ -2111,6 +2104,15 @@ bool MeterWindow::ReadSkin() SetWindowPositionVariables(m_ScreenX, m_ScreenY); SetWindowSizeVariables(0, 0); + // Global settings + const std::wstring& group = m_Parser.ReadString(L"Rainmeter", L"Group", L""); + if (!group.empty()) + { + m_SkinGroup += L'|'; + m_SkinGroup += group; + } + InitializeGroup(m_SkinGroup); + static const RECT defMargins = {0}; m_BackgroundMargins = m_Parser.ReadRECT(L"Rainmeter", L"BackgroundMargins", defMargins); m_DragMargins = m_Parser.ReadRECT(L"Rainmeter", L"DragMargins", defMargins); diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 99a7d6a2..0ba924e2 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -346,6 +346,7 @@ private: std::wstring m_OnUpdateAction; std::wstring m_OnWakeAction; + std::wstring m_SkinGroup; std::wstring m_BackgroundName; RECT m_BackgroundMargins; RECT m_DragMargins;