From 1d5490aa9841adbab72186ec7e472e0e4db84c96 Mon Sep 17 00:00:00 2001 From: spx Date: Wed, 8 Dec 2010 06:10:22 +0000 Subject: [PATCH] Code cleanup. --- Library/MeterWindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 0f57f435..439dbcfd 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1742,8 +1742,6 @@ bool CMeterWindow::ReadSkin() } m_Author = m_Parser.ReadString(L"Rainmeter", L"Author", L""); - m_BackgroundName = m_Parser.ReadString(L"Rainmeter", L"Background", L""); - m_BackgroundName = MakePathAbsolute(m_BackgroundName); static const RECT defMargins = {0}; m_BackgroundMargins = m_Parser.ReadRECT(L"Rainmeter", L"BackgroundMargins", defMargins); @@ -1758,9 +1756,17 @@ bool CMeterWindow::ReadSkin() m_DynamicWindowSize = 0!=m_Parser.ReadInt(L"Rainmeter", L"DynamicWindowSize", 0); - if ((m_BackgroundMode == BGMODE_IMAGE || m_BackgroundMode == BGMODE_SCALED_IMAGE || m_BackgroundMode == BGMODE_TILED_IMAGE) && m_BackgroundName.empty()) + if (m_BackgroundMode == BGMODE_IMAGE || m_BackgroundMode == BGMODE_SCALED_IMAGE || m_BackgroundMode == BGMODE_TILED_IMAGE) { - m_BackgroundMode = BGMODE_COPY; + m_BackgroundName = m_Parser.ReadString(L"Rainmeter", L"Background", L""); + if (!m_BackgroundName.empty()) + { + m_BackgroundName = MakePathAbsolute(m_BackgroundName); + } + else + { + m_BackgroundMode = BGMODE_COPY; + } } m_RightMouseDownAction = m_Parser.ReadString(L"Rainmeter", L"RightMouseDownAction", L"", false);