It is currently March 28th, 2024, 10:50 pm

Tooltip hot-spot

Report bugs with the Rainmeter application and suggest features.
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:38 pm 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.
Aha. Right. Now I see what are you talking about and it's true. Didn't know about this small difference.
So, again: there always is something to be learned...
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 »

Code: Select all

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

[Variables]

[MeterShape]
Meter=Shape
X=100
Y=100
SolidColor=255,0,0,100
Shape=Rectangle 1.5,1.5,300,100 | StrokeWidth 3 | Stroke Color 255,255,255,255 | Fill Color 66,188,255,255 | Rotate 45
MouseOverAction=[!SetOption MeterShape SolidColor "255,0,0,255"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterShape SolidColor "255,0,0,100"][!UpdateMeter *][!Redraw]

GIF.gif


The "meter container" is red, indicated with SolidColor... A meter, or the skin itself, can't ever "grow" up or left. It can and will grow down or right to accommodate the rotated shape if you don't force a W and/or H, but the bit that is rotated out of the meter up or left is just drawn outside the meter, as long as it is still inside the overall skin.

So this "shape" extends outside of the "meter container", and yet the mouse detection is what you would expect and desire.

Mouse detection is on the "shape", no matter how it is positioned, rotated, scaled, (and I suspect TransformationMatrix'd), irregardless of the context of the meter container.

Unfortunately, this is not, and cannot be, true of how ToolTip is detected... ToolTip will always be detected, and only detected, on that red square that defines the "meter container". To change this, we would have to "roll-our-own" ToolTip functionality, and that would be pretty complicated and difficult given how tooltips need to react to being outside of the top, bottom, left, right of the screen. There is a lot of "positional self-awareness" baked into tooltips in Windows.
You do not have the required permissions to view the files attached to this post.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Tooltip hot-spot

Post by pul53dr1v3r »

so, there is no way to prevent a ToolTip from appearing if a shape is over it?

Image
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Tooltip hot-spot

Post by Yamajac »

Pul53dr1v3r wrote: December 11th, 2019, 8:01 pm so, there is no way to prevent a ToolTip from appearing if a shape is over it?

Image
When the shape is drawn over top of it, just hide the meter with the tooltip. Or implement your own tooltip instead of relying on Windows' built in tooltips.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

Yamajac wrote: December 11th, 2019, 8:52 pm When the shape is drawn over top of it, just hide the meter with the tooltip. Or implement your own tooltip instead of relying on Windows' built in tooltips.
Yep, but the Tooltip is shown in this case as well, even if the shape is over the meter with the tooltip.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Hi jsmorley

Thanks for detailed clarifications.
Unfortunately, this is not, and cannot be, true of how ToolTip is detected... ToolTip will always be detected, and only detected, on that red square that defines the "meter container". To change this, we would have to "roll-our-own" ToolTip functionality, and that would be pretty complicated and difficult
Although just difficult for me to completely realize, now I am convinced. I didn't imagine that the Shape mater has such specific character than other meters. I will live with this...:-)
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Tooltip hot-spot

Post by pul53dr1v3r »

Yamajac wrote: December 11th, 2019, 8:52 pm
:rosegift:
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Tooltip hot-spot

Post by Yamajac »

balala wrote: December 11th, 2019, 9:05 pm Yep, but the Tooltip is shown in this case as well, even if the shape is over the meter with the tooltip.
Not if you hide it, which is what I said to do in the comment you quoted.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

Yamajac wrote: December 11th, 2019, 10:57 pm Not if you hide it, which is what I said to do in the comment you quoted.
Depends on what do you mean by hide it? If you hide it through a Hidden=1 option or a !HideMeter bang, then indeed the Tooltip isn't shown. But if you place a Shape meter over the meter having the Tooltip, the Tooltip is shown when you're hovering the mouse over it.
Just because you said:
Yamajac wrote: December 11th, 2019, 8:52 pm When the shape is drawn over top of it,
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Tooltip hot-spot

Post by Yamajac »

balala wrote: December 12th, 2019, 1:19 pm Depends on what do you mean by hide it? If you hide it through a Hidden=1 option or a !HideMeter bang, then indeed the Tooltip isn't shown. But if you place a Shape meter over the meter having the Tooltip, the Tooltip is shown when you're hovering the mouse over it.
Just because you said:
Hiding a meter means using !hidemeter or setting Hidden=1, yes. Drawing over top of it is just occlusion.