mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Added MattKing's code to enable the standard "hand pointer" mouse cursor when you hover over a meter with any "MouseAction" on it or a button.
This behavior is ON by default. If you do not want the cursor change on a meter or button, set MouseActionCursor=0 on the Meter or button. Example of disabling mouse cursor change: [Meter] Meter=Image W=100 H=100 SolidColor=0,0,0,255 LeftMouseUpAction=!Execute ["http://rainmeter.net"] MouseActionCursor=0 Note: If you have a button with a meter (either image or text) on TOP of it, you will need to set MouseActionCursor=0 on the image/text meter even if it doesn't have a mouse action, or the button will not change cursors.
This commit is contained in:
@ -2430,6 +2430,7 @@ LRESULT CMeterWindow::OnMouseMove(WPARAM wParam, LPARAM lParam)
|
||||
|
||||
// Handle buttons
|
||||
bool redraw = false;
|
||||
bool drawCursor = false;
|
||||
std::list<CMeter*>::iterator j = m_Meters.begin();
|
||||
for( ; j != m_Meters.end(); j++)
|
||||
{
|
||||
@ -2441,7 +2442,18 @@ LRESULT CMeterWindow::OnMouseMove(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
redraw |= button->MouseMove(pos);
|
||||
}
|
||||
|
||||
if((*j)->HitTest(pos.x, pos.y) && (*j)->HasMouseActionCursor())
|
||||
{
|
||||
drawCursor = ((*j)->HasMouseAction() || button);
|
||||
}
|
||||
}
|
||||
|
||||
if(drawCursor)
|
||||
SetCursor(LoadCursor(NULL, IDC_HAND));
|
||||
else
|
||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||
|
||||
if (redraw)
|
||||
{
|
||||
Redraw();
|
||||
@ -2856,6 +2868,7 @@ LRESULT CMeterWindow::OnLeftButtonDown(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
redraw |= button->MouseDown(pos);
|
||||
}
|
||||
|
||||
}
|
||||
if (redraw)
|
||||
{
|
||||
|
Reference in New Issue
Block a user