mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Dynamic variables can be used to change the font in the string Meter.cpp.
Removed the error message if the meter's dimensions are 0.
This commit is contained in:
@ -164,6 +164,11 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
{
|
||||
WCHAR tmpName[256];
|
||||
|
||||
// Store the current font values so we know if the font needs to be updated
|
||||
std::wstring oldFontFace = m_FontFace;
|
||||
int oldFontSize = m_FontSize;
|
||||
TEXTSTYLE oldStyle = m_Style;
|
||||
|
||||
// Read common configs
|
||||
CMeter::ReadConfig(section);
|
||||
|
||||
@ -286,6 +291,14 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
{
|
||||
m_DimensionsDefined = true;
|
||||
}
|
||||
|
||||
if (m_Initialized &&
|
||||
(oldFontFace != m_FontFace ||
|
||||
oldFontSize != m_FontSize ||
|
||||
oldStyle != m_Style))
|
||||
{
|
||||
Initialize(); // Recreate the font
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user