spx 2014-06-08 22:12:15 +09:00
parent 13d6a20805
commit 6eafb835ad
2 changed files with 13 additions and 10 deletions

View File

@ -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);

View File

@ -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;