diff --git a/Library/Meter.cpp b/Library/Meter.cpp index 1a3ef933..98e4d334 100644 --- a/Library/Meter.cpp +++ b/Library/Meter.cpp @@ -447,6 +447,12 @@ bool CMeter::Update() */ bool CMeter::BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional) { + const std::wstring& style = parser.ReadString(section, L"MeterStyle", L""); + if (!style.empty()) + { + parser.SetStyleTemplate(style); + } + const std::wstring& measureName = parser.ReadString(section, L"MeasureName", L""); // The meter is not bound to anything diff --git a/Library/Meter.h b/Library/Meter.h index 7ea6ea64..9de02ace 100644 --- a/Library/Meter.h +++ b/Library/Meter.h @@ -40,7 +40,7 @@ public: virtual UINT GetTypeID() = 0; void ReadOptions(CConfigParser& parser) { ReadOptions(parser, GetName()); parser.ClearStyleTemplate(); } - void BindMeasures(CConfigParser& parser) { BindMeasures(parser, GetName()); } + void BindMeasures(CConfigParser& parser) { BindMeasures(parser, GetName()); parser.ClearStyleTemplate(); } virtual void Initialize(); virtual bool Update(); diff --git a/Library/MeterHistogram.cpp b/Library/MeterHistogram.cpp index 71682749..931cef34 100644 --- a/Library/MeterHistogram.cpp +++ b/Library/MeterHistogram.cpp @@ -653,7 +653,7 @@ bool CMeterHistogram::Draw(Graphics& graphics) */ void CMeterHistogram::BindMeasures(CConfigParser& parser, const WCHAR* section) { - if (BindPrimaryMeasure(parser, section, true)) + if (BindPrimaryMeasure(parser, section, false)) { const std::wstring* secondaryMeasure = &parser.ReadString(section, L"MeasureName2", L""); if (secondaryMeasure->empty()) diff --git a/Library/MeterLine.cpp b/Library/MeterLine.cpp index 9e146f95..21984eb9 100644 --- a/Library/MeterLine.cpp +++ b/Library/MeterLine.cpp @@ -469,7 +469,7 @@ bool CMeterLine::Draw(Graphics& graphics) */ void CMeterLine::BindMeasures(CConfigParser& parser, const WCHAR* section) { - if (BindPrimaryMeasure(parser, section, true)) + if (BindPrimaryMeasure(parser, section, false)) { BindSecondaryMeasures(parser, section); }