It is currently March 29th, 2024, 3:14 pm

Tooltip hot-spot

Report bugs with the Rainmeter application and suggest features.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Tooltip hot-spot

Post by mak_kawa »

As always, I am not sure if it is a Rainmeter bug or caused by my skin coding. Or as always :-) maybe I am missing something...if so, sorry.

Tooltip "hot-spot" in shape meter spills over its outline. When only a shape meter is shown, there is no problem. But, when some other meters are overlaying the shape meter at some degree, tooltip appears outside the shape meter. See the attachment.
test.gif
Sample code here for reproduction of the problem.

Code: Select all

[Rainmeter]
Update=1000

[ClickableShape]
Meter=Shape
Shape=Ellipse 90,90,90 | Fill Color 128,128,128,192 | StrokeWidth 1 | Stroke Color 0,0,0,255
LeftMouseUpAction=[!ToggleMeterGroup TestCircles]
ToolTipText=Test TooltipText

[Circle1]
Meter=Shape
Shape=Ellipse 30,180,20
Group=TestCircles
Hidden=1

[Circle2]
Meter=Shape
Shape=Ellipse 70,180,20
Group=TestCircles
Hidden=1

[Circle3]
Meter=Shape
Shape=Ellipse 110,180,20
Group=TestCircles
Hidden=1

[Circle4]
Meter=Shape
Shape=Ellipse 150,180,20
Group=TestCircles
Hidden=1
You do not have the required permissions to view the files attached to this post.
Last edited by mak_kawa on December 11th, 2019, 10:16 pm, edited 1 time in total.
User avatar
Brian
Developer
Posts: 2674
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Tooltip hot-spot

Post by Brian »

Tooltips work on the meter's bounds, not the "drawn" pixels.

As an example, if you place a SolidColor on your shape meter...you will see "where" the bounds of the shape are, and if you hover the mouse over any area of the meter, the tooltip will show.

Code: Select all

[ClickableShape]
Meter=Shape
Shape=Ellipse 90,90,90 | Fill Color 128,128,128,192 | StrokeWidth 1 | Stroke Color 0,0,0,255
LeftMouseUpAction=[!ToggleMeterGroup TestCircles]
ToolTipText=Test TooltipText
SolidColor=255,0,0
Likewise, even a meter that is partially covered will still show its tooltip when hovered over its meter's bounds.

Code: Select all

[1]
Meter=Image
X=10
Y=10
W=100
H=100
SolidColor=255,0,0
ToolTipText=Test

[2]
Meter=Image
X=50
Y=50
W=100
H=100
SolidColor=0,0,255
-Brian
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Hi Brian

Thank you for reply and suggestion.
I have set SolidColor for the meter and realized what you say.

But I have one more question. When I don't set SolidColor option for the meter, it is 0,0,0,0 as default. So the background of the meter is invisible. And when I place mouse cursor outside the shape outline on the invisible area, ToolTip is not shown, as above attached GIF. Why?

When I set it to 0,0,0,1 (=almost invisible but not invisible), tooltip is shown all over the meter as you said.
This means Tooltip works on "visible" area, not whole area, of the meter?

Sorry, if I am wrong.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Tooltip hot-spot

Post by Yamajac »

mak_kawa wrote: December 11th, 2019, 7:09 am This means Tooltip works on "visible" area, not whole area, of the meter?
Tooltip works similarly to MouseOverAction.


If you've ever used SolidColor = 0,0,0,1 to make a text meter clickable then it's a similar idea.


Also, it's not on the visible area of that meter specifically, but the visible area of the skin where that meter's bounding box is. When you mouse over a solid bit of any rainmeter skin, rainmeter finds ALL of the meters that cover that point and trigger the mouseover actions and the tooltip text.

The code below should help you understand how meter bounding boxes work. Mouse hover actions will trigger on ALL meters in that location. Clicks and scroll wheels only trigger on the topmost meter (the one farther down the .ini).

Code: Select all

[rainmeter]
Update = 1000


[Invisible]
Meter = Shape
Shape = Rectangle 0,0,100,100 | FillColor 100,0,0,0 | StrokeWidth 0
ToolTipText = LongerTooltipSoItShowsBelowTheShorterOne
LeftMouseUpAction = [!log Invisible debug]
MouseOverAction = [!log Invisible debug]

[NotInvisible]
Meter = Shape
Shape = Rectangle 0,0,100,100 | FillColor 0,100,0,255 | StrokeWidth 0
ToolTipText = ShortTooltip
LeftMouseUpAction = [!Log NotInvisible debug]
MouseOverAction = [!log NotInvisible debug]
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Hi Yamajac (and others)

I have loaded the code you provided, but honestly I don't understand your intension. Maybe I'm a moron.:-)

I have made further test. It shows that mouse hover area and tooltip hot-spot seem to be not in concordance, at least for my eyes.
test2.gif
Test code here;

Code: Select all

[Rainmeter]
Update=1000

[ClickableShape]
Meter=Shape
SolidColor=255,0,0,0
Shape=Ellipse 90,90,90 | Fill Color 128,128,128,192 | StrokeWidth 1 | Stroke Color 0,0,0,255
MouseOverAction=[!SetOption ClickableShape Shape "Ellipse 90,90,90 | Fill Color 255,255,255,192 | StrokeWidth 1 | Stroke Color 0,0,0,255"][!UpdateMeter ClickableShape][!Redraw]
MouseLeaveAction=[!SetOption ClickableShape Shape "Ellipse 90,90,90 | Fill Color 128,128,128,192 | StrokeWidth 1 | Stroke Color 0,0,0,255"][!UpdateMeter ClickableShape][!Redraw]
LeftMouseUpAction=[!ToggleMeterGroup TestCircles]
ToolTipText=Test TooltipText

[Circle1]
Meter=Shape
SolidColor=255,0,0,0
Shape=Ellipse 30,180,20
Group=TestCircles
Hidden=1

[Circle2]
Meter=Shape
SolidColor=255,0,0,0
Shape=Ellipse 70,180,20
Group=TestCircles
Hidden=1

[Circle3]
Meter=Shape
SolidColor=255,0,0,0
Shape=Ellipse 110,180,20
Group=TestCircles
Hidden=1

[Circle4]
Meter=Shape
SolidColor=255,0,0,0
Shape=Ellipse 150,180,20
Group=TestCircles
Hidden=1
As already said, when single shape meter is shown, both mouse hover area and tooltip hot-spot are restricted visible area of the meter.
But once other meters overlaying the shape meter are shown, mouse hover area and tooltip hot-spot are not concordant at all.

I am not going to argue with Rainmeter experts as Brian, you, and etc. :-)
What I beg is to load my test code on your Rainmeter and actually operate it. If what you see is diffrerent from my result (as attached GIF), something about my system would be wrong. If what you see is same as my experience, please tell me what you think. And if you say "Rainmeter is like this", I will be convinced. :-)

Probably because my English is so terrible, it may be difficult that you understand what I want to express. Really sorry.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

mak_kawa wrote: December 11th, 2019, 7:09 am But I have one more question. When I don't set SolidColor option for the meter, it is 0,0,0,0 as default. So the background of the meter is invisible. And when I place mouse cursor outside the shape outline on the invisible area, ToolTip is not shown, as above attached GIF. Why?

When I set it to 0,0,0,1 (=almost invisible but not invisible), tooltip is shown all over the meter as you said.
This means Tooltip works on "visible" area, not whole area, of the meter?
Exactly.
Nor the MouseOverAction, nor the Tooltip doesn't work when you're hovering the mouse over a completely transparent area of the meter. The sections which work must have at least a transparency of 1 from 255.
That's why when you don't set a SolidColor on the meter (so the "background" of the meter is completely transparent) and hovering the mouse over this transparent background, the MouseOverAction isn't executed and the tooltip isn't shown. If on the other hand you set a SolidColor=0,0,0,1 option (or any other color, with a transparency greater than 0) both options will work.
Transparent areas are simply not taken into account.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Hi balala (and others)
Thank you for response.

And...how about "But once other meters overlaying the shape meter are shown, mouse hover area and tooltip hot-spot are not concordant at all." in my above post?

As seen in my attached GIF, tooltip is shown when mouse cursor is *not* main circle shape when other meters are overlaid. That is, tooltip apperance and mouse hover action are not synchronous.

Honestly in fact, this problem is not so serious for me. I am going to give up if I am wrong and missing something. I will accept this behavior as is...:-)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Tooltip hot-spot

Post by jsmorley »

It should be noted that the Shape meter uses a different form of mouse detection for the mouse actions in Rainmeter:
https://docs.rainmeter.net/manual/meters/shape/#MouseDetection

This is a vastly better way to detect the mouse for "over" and "clicks" and such.

It detects only on the solid contents of the actual shape in the Shape meter, and not on the underlying meter container, it doesn't care if the meter container itself is solid or not, or if there are any other solid meters "behind" the shape meter. It's all about the actual shape.

However, this does not apply to mouse detection for the ToolTip functionality. That is not entirely controlled by Rainmeter, but more by Windows itself, and is based on the the underlying meter container, just like mouse actions are in most other meters.

There may be some value to using the ToolTipHidden option in conjunction with a Shape meter to make this behave better..
https://docs.rainmeter.net/manual/meters/general-options/tooltips/#ToolTipHidden

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=382

; Demonstrates how the mouse is detected on Shape meters.

[MeterShapes]
Meter=Shape
X=0
Y=0
W=200
H=90
SolidColor=98,178,209,90
Shape=Rectangle 30,30,350,30,14 | Extend MyModifiers1
Shape2=Rectangle 280,2,30,88
Shape3=Combine Shape | XOR Shape2
MyModifiers1=Fill Color 10,45,59,255 | StrokeWidth 4 | Stroke Color 70,129,189,255
ToolTipType=1
ToolTipText=Tooltip Enabled!
ToolTipHidden=1
MouseOverAction=[!SetOption MeterShapes ToolTipHidden "0"][!SetOption MeterMouseDetect Text "Mouse Detected"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterShapes ToolTipHidden "1"][!SetOption MeterMouseDetect Text "Mouse Not Detected"][!UpdateMeter *][!Redraw]

[MeterLabelForMeter]
Meter=String
X=2
Y=2
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=The Meter

[MeterLabelForShape]
Meter=String
X=38
Y=37
FontSize=12
FontColor=98,178,209,255
AntiAlias=1
Text=The Shapes

[MeterMouseDetect]
Meter=String
X=2
Y=105
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Move Mouse Over Bar

GIF.gif
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

jsmorley wrote: December 11th, 2019, 4:21 pm It should be noted that the Shape meter uses a different form of mouse detection for the mouse actions in Rainmeter:
In a Shape meter, the mouse is only detected on any solid part of the drawing created by any and all shapes in the meter. It is not dependent on any rectangular meter container. The mouse will instead be detected on any solid pixel created by the actual shape objects being drawn.
Yes, but this is true for any kind of meter. No meter detects the mouse hovering over its transparent part.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Tooltip hot-spot

Post by jsmorley »

balala wrote: December 11th, 2019, 4:33 pm Yes, but this is true for any kind of meter. No meter detects the mouse hovering over its transparent part.
Correct, but all other meters, except Shape and Button, will detect the mouse on ANY solid bit of the underlying meter container. That may mean that there is a SolidColor that isn't set with a transparency of zero, or there may be another meter "behind" the meter that has solid bits, or even the overall background of the skin may have solid bits behind the meter.

With most meters, the rule is "If the mouse is inside the W and H of the meter container, and the pixel it is over is solid, for ANY reason, the mouse is detected.".

Shape (and button) meters are entirely different, as they only detect the mouse on solid bits of the Shape or Button images created by the meter, and don't care a bit about the size or transparency of the underlying meter container or anything behind it.

The rub is that ToolTip does not obey these new, and far better, mouse detection rules when used on a Shape or Button meter. It falls back to the old rules used by most other meters in Rainmeter.

Mind you, for many if not most other meter types, the original rules are not a bad thing. It makes clicking on a String meter far easier than if only the actual font glyph itself detected the mouse. You just set SolidColor=0,0,0,1 on the String meter, and the behavior is much better. In the case of Shape though, the shape itself may extend "outside" the meter container, and you surely want the mouse detected in that case. In addition, you are given far more "control" over mouse detection with a Shape meter. You can have it be detected only on the actual shape, or you can add an "almost invisible" background shape to the meter to make it behave like a String meter if you want.