mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed resizing of certain meters with !SetOption
This commit is contained in:
parent
9f44e5cfae
commit
78542ec2be
@ -294,19 +294,17 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
||||
bool oldWDefined = m_WDefined;
|
||||
m_W = parser.ReadInt(section, L"W", m_W);
|
||||
m_WDefined = parser.GetLastValueDefined();
|
||||
if (!m_WDefined && oldWDefined)
|
||||
if (!m_WDefined && oldWDefined && IsFixedSize())
|
||||
{
|
||||
m_W = 0;
|
||||
parser.SetValue(section, L"W", L"0");
|
||||
}
|
||||
|
||||
bool oldHDefined = m_HDefined;
|
||||
m_H = parser.ReadInt(section, L"H", m_H);
|
||||
m_HDefined = parser.GetLastValueDefined();
|
||||
if (!m_HDefined && oldHDefined)
|
||||
if (!m_HDefined && oldHDefined && IsFixedSize())
|
||||
{
|
||||
m_H = 0;
|
||||
parser.SetValue(section, L"H", L"0");
|
||||
}
|
||||
|
||||
bool oldHidden = m_Hidden;
|
||||
|
@ -120,6 +120,8 @@ protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return true; }
|
||||
|
||||
bool BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional);
|
||||
void BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return m_ImageName.empty(); }
|
||||
|
||||
private:
|
||||
enum ORIENTATION
|
||||
{
|
||||
|
@ -46,6 +46,8 @@ protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return false; }
|
||||
|
||||
private:
|
||||
bool HitTest2(int px, int py, bool checkAlpha);
|
||||
|
||||
|
@ -165,9 +165,10 @@ void CMeterHistogram::Initialize()
|
||||
DisposeBuffer();
|
||||
|
||||
// Create buffers for values
|
||||
if (m_W > 0 || m_H > 0)
|
||||
if (m_W >= 0 || m_H >= 0)
|
||||
{
|
||||
int maxSize = m_GraphHorizontalOrientation ? m_H : m_W;
|
||||
maxSize = (maxSize == 0) ? 1 : maxSize;
|
||||
m_PrimaryValues = new double[maxSize]();
|
||||
if (secondaryMeasure)
|
||||
{
|
||||
@ -360,6 +361,7 @@ bool CMeterHistogram::Update()
|
||||
|
||||
++m_MeterPos;
|
||||
int maxSize = m_GraphHorizontalOrientation ? m_H : m_W;
|
||||
maxSize = (maxSize == 0) ? 1 : maxSize;
|
||||
m_MeterPos %= maxSize;
|
||||
|
||||
m_MaxPrimaryValue = measure->GetMaxValue();
|
||||
|
@ -38,6 +38,8 @@ protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return m_PrimaryImageName.empty(); }
|
||||
|
||||
private:
|
||||
void DisposeBuffer();
|
||||
|
||||
|
@ -38,6 +38,8 @@ protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return m_ImageName.empty(); }
|
||||
|
||||
private:
|
||||
void LoadImage(const std::wstring& imageName, bool bLoadAlways);
|
||||
|
||||
|
@ -47,6 +47,8 @@ protected:
|
||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||
|
||||
virtual bool IsFixedSize() { return false; }
|
||||
|
||||
private:
|
||||
enum TEXTSTYLE
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user