diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index c3c0258c..6e2539f4 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -3158,7 +3158,7 @@ void CMeterWindow::HandleButtons(POINT pos, BUTTONPROC proc, bool execute) if (!cursor && ((*j)->HasMouseAction() || button) && - (*j)->GetMouse().GetCursorType() != MOUSECURSOR_ARROW && + (*j)->GetMouse().GetCursorState() && (*j)->HitTest(pos.x, pos.y)) { cursor = (*j)->GetMouse().GetCursor(); diff --git a/Library/Mouse.cpp b/Library/Mouse.cpp index 7ac6c607..bd45df36 100644 --- a/Library/Mouse.cpp +++ b/Library/Mouse.cpp @@ -24,7 +24,8 @@ CMouse::CMouse() : m_CursorType(MOUSECURSOR_HAND), - m_CustomCursor() + m_CustomCursor(), + m_CursorState(true) { } @@ -49,18 +50,14 @@ void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWind m_OverAction = parser.ReadString(section, L"MouseOverAction", L"", false); m_LeaveAction = parser.ReadString(section, L"MouseLeaveAction", L"", false); - const WCHAR* mouseCursor = parser.ReadString(section, L"MouseActionCursor", L"").c_str(); + m_CursorState = 0!=parser.ReadInt(section, L"MouseActionCursor", meterWindow->GetMouse().GetCursorState()); - // For backwards compatibility - int mouseCursorInt = (*mouseCursor == L'(') ? CConfigParser::ParseInt(mouseCursor, 0) : -1; - - if (mouseCursorInt == 1 || - _wcsicmp(mouseCursor, L"HAND") == 0) + const WCHAR* mouseCursor = parser.ReadString(section, L"MouseActionCursorName", L"").c_str(); + if (_wcsicmp(mouseCursor, L"HAND") == 0) { m_CursorType = MOUSECURSOR_HAND; } - else if (mouseCursorInt == 0 || - _wcsicmp(mouseCursor, L"ARROW") == 0) + else if (_wcsicmp(mouseCursor, L"ARROW") == 0) { m_CursorType = MOUSECURSOR_ARROW; } @@ -91,10 +88,10 @@ void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWind else { // Inherit from [Rainmeter]. - m_CursorType = meterWindow->GetMouse().m_CursorType; + m_CursorType = meterWindow->GetMouse().GetCursorType(); if (m_CursorType == MOUSECURSOR_CUSTOM) { - mouseCursor = meterWindow->GetParser().ReadString(L"Rainmeter", L"MouseActionCursor", L"").c_str();; + mouseCursor = meterWindow->GetParser().ReadString(L"Rainmeter", L"MouseActionCursorName", L"").c_str(); } } diff --git a/Library/Mouse.h b/Library/Mouse.h index e46ee5e5..f4f6ea41 100644 --- a/Library/Mouse.h +++ b/Library/Mouse.h @@ -56,6 +56,7 @@ public: MOUSECURSOR GetCursorType() const { return m_CursorType; } HCURSOR GetCursor() const; + bool GetCursorState() const {return m_CursorState; } void DestroyCustomCursor(); @@ -88,6 +89,7 @@ private: MOUSECURSOR m_CursorType; HCURSOR m_CustomCursor; + bool m_CursorState; }; #endif