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;
|
bool oldWDefined = m_WDefined;
|
||||||
m_W = parser.ReadInt(section, L"W", m_W);
|
m_W = parser.ReadInt(section, L"W", m_W);
|
||||||
m_WDefined = parser.GetLastValueDefined();
|
m_WDefined = parser.GetLastValueDefined();
|
||||||
if (!m_WDefined && oldWDefined)
|
if (!m_WDefined && oldWDefined && IsFixedSize())
|
||||||
{
|
{
|
||||||
m_W = 0;
|
m_W = 0;
|
||||||
parser.SetValue(section, L"W", L"0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oldHDefined = m_HDefined;
|
bool oldHDefined = m_HDefined;
|
||||||
m_H = parser.ReadInt(section, L"H", m_H);
|
m_H = parser.ReadInt(section, L"H", m_H);
|
||||||
m_HDefined = parser.GetLastValueDefined();
|
m_HDefined = parser.GetLastValueDefined();
|
||||||
if (!m_HDefined && oldHDefined)
|
if (!m_HDefined && oldHDefined && IsFixedSize())
|
||||||
{
|
{
|
||||||
m_H = 0;
|
m_H = 0;
|
||||||
parser.SetValue(section, L"H", L"0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oldHidden = m_Hidden;
|
bool oldHidden = m_Hidden;
|
||||||
|
@ -120,6 +120,8 @@ protected:
|
|||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
virtual void BindMeasures(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);
|
bool BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional);
|
||||||
void BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section);
|
void BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
virtual bool IsFixedSize() { return m_ImageName.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum ORIENTATION
|
enum ORIENTATION
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
virtual bool IsFixedSize() { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool HitTest2(int px, int py, bool checkAlpha);
|
bool HitTest2(int px, int py, bool checkAlpha);
|
||||||
|
@ -165,9 +165,10 @@ void CMeterHistogram::Initialize()
|
|||||||
DisposeBuffer();
|
DisposeBuffer();
|
||||||
|
|
||||||
// Create buffers for values
|
// 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;
|
int maxSize = m_GraphHorizontalOrientation ? m_H : m_W;
|
||||||
|
maxSize = (maxSize == 0) ? 1 : maxSize;
|
||||||
m_PrimaryValues = new double[maxSize]();
|
m_PrimaryValues = new double[maxSize]();
|
||||||
if (secondaryMeasure)
|
if (secondaryMeasure)
|
||||||
{
|
{
|
||||||
@ -360,6 +361,7 @@ bool CMeterHistogram::Update()
|
|||||||
|
|
||||||
++m_MeterPos;
|
++m_MeterPos;
|
||||||
int maxSize = m_GraphHorizontalOrientation ? m_H : m_W;
|
int maxSize = m_GraphHorizontalOrientation ? m_H : m_W;
|
||||||
|
maxSize = (maxSize == 0) ? 1 : maxSize;
|
||||||
m_MeterPos %= maxSize;
|
m_MeterPos %= maxSize;
|
||||||
|
|
||||||
m_MaxPrimaryValue = measure->GetMaxValue();
|
m_MaxPrimaryValue = measure->GetMaxValue();
|
||||||
|
@ -38,6 +38,8 @@ protected:
|
|||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
virtual bool IsFixedSize() { return m_PrimaryImageName.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DisposeBuffer();
|
void DisposeBuffer();
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
virtual bool IsFixedSize() { return m_ImageName.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadImage(const std::wstring& imageName, bool bLoadAlways);
|
void LoadImage(const std::wstring& imageName, bool bLoadAlways);
|
||||||
|
@ -47,6 +47,8 @@ protected:
|
|||||||
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
virtual void ReadOptions(CConfigParser& parser, const WCHAR* section);
|
||||||
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
virtual void BindMeasures(CConfigParser& parser, const WCHAR* section);
|
||||||
|
|
||||||
|
virtual bool IsFixedSize() { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum TEXTSTYLE
|
enum TEXTSTYLE
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user