This commit is contained in:
spx 2013-03-11 05:08:00 +09:00
parent aecef0b5f9
commit 27fe4a1e1c

View File

@ -3283,14 +3283,16 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU men
} }
// Add custom actions to the context menu // Add custom actions to the context menu
std::wstring contextTitle = meterWindow->GetParser().ReadString(L"Rainmeter", L"ContextTitle", L"");
if (!contextTitle.empty())
{
auto isTitleSeparator = [](const std::wstring& title) auto isTitleSeparator = [](const std::wstring& title)
{ {
return title.find_first_not_of(L'-') == std::wstring::npos; return title.find_first_not_of(L'-') == std::wstring::npos;
}; };
std::wstring contextTitle = meterWindow->GetParser().ReadString(L"Rainmeter", L"ContextTitle", L"");
std::wstring contextAction = meterWindow->GetParser().ReadString(L"Rainmeter", L"ContextAction", L""); std::wstring contextAction = meterWindow->GetParser().ReadString(L"Rainmeter", L"ContextAction", L"");
if (!contextTitle.empty() && (!contextAction.empty() || isTitleSeparator(contextTitle))) if (!contextAction.empty() || isTitleSeparator(contextTitle))
{ {
std::vector<std::wstring> cTitles; std::vector<std::wstring> cTitles;
WCHAR buffer[128]; WCHAR buffer[128];
@ -3361,6 +3363,7 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU men
} }
} }
} }
}
return skinMenu; return skinMenu;
} }