It is currently March 28th, 2024, 10:14 am

Tooltip on string meter doesn't show

Get help with creating, editing & fixing problems with skins
Post Reply
alexbib
Posts: 3
Joined: February 17th, 2018, 2:24 am

Tooltip on string meter doesn't show

Post by alexbib »

I'm trying to get a tooltip to show up when the mouse is over a certain string, but no matter what I do it doesn't, so there must be something I'm misunderstanding. Here is the code:

Code: Select all

[TopMem1]
Meter=String
MeterStyle=String
MeasureName=Mem1
X=(#BgWidth# - (#TextPosX# + #AccTextOffset# + 2))
Y=0r
Scale=1048576
StringAlign=right
Text="%1 MB"
ToolTipText="Why won't you f****** show up?"
FontFace=#FontFace#
FontColor=#ColorInfoText2#
Can someone help?

Thanks!
Alex
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Tooltip on string meter doesn't show

Post by eclectic-tech »

alexbib wrote:I'm trying to get a tooltip to show up when the mouse is over a certain string, but no matter what I do it doesn't, so there must be something I'm misunderstanding. Here is the code:

Code: Select all

[TopMem1]
Meter=String
MeterStyle=String
MeasureName=Mem1
X=(#BgWidth# - (#TextPosX# + #AccTextOffset# + 2))
Y=0r
Scale=1048576
StringAlign=right
Text="%1 MB"
ToolTipText="Why won't you f****** show up?"
FontFace=#FontFace#
FontColor=#ColorInfoText2#
Can someone help?

Thanks!
Alex
The code looks okay...

What is in MeterStyle [String] section?
It is a good habit to add SolidColor=0,0,0,1 to string meters for better mouseover detection.

Is ToolTipHidden=1 in the [Rainmeter] section?
If so, change the value to zero.
alexbib
Posts: 3
Joined: February 17th, 2018, 2:24 am

Re: Tooltip on string meter doesn't show

Post by alexbib »

eclectic-tech wrote:The code looks okay...

What is in MeterStyle [String] section?
It is a good habit to add SolidColor=0,0,0,1 to string meters for better mouseover detection.

Is ToolTipHidden=1 in the [Rainmeter] section?
If so, change the value to zero.
The style section contains

Code: Select all

FontSize=#FontSize1#
FontFace=#FontName#
StringAlign=Left
X=(#TextPosX# + #AccTextOffset#)
Y=12r
AntiAlias=1
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#
ToolTipHidden doesn't appear. And I've got another tooltip working on the same skin. It's on a fake image on top of an icon (somehow putting it in the icon itself doesn't work either):

Code: Select all

[LogoMouseRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([Logo:X] * #Scale#)
Y=([Logo:Y] * #Scale#)
W=([Logo:W] * #Scale#)
H=([Logo:H] * #Scale#)
LeftMouseUpAction=["taskmgr.exe"]
ToolTipText="Open Task Manager"
DynamicVariables=1
UpdateDivider=-1
Almost all the code is scavenged from SilverAzide's Gadgets, as I'm making an extra skin to display the top processes that fits with that suite.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Tooltip on string meter doesn't show

Post by jsmorley »

The issue is likely the fact that TransformationMatrix does not change the mouse "target" on a meter when it is use to "scale" the size of a meter. The mouse target will remain the same size and position that the meter was before the TransformationMatrix is applied.

The solution is going to probably entail creating an Image meter with SolidColor=0,0,0,1 and a W (width) and H (height) that is also set dynamically based on the scale factor you are using. When the W and / or H is applied to the meter, then the mouse target is obviously going to be the size and shape of the meter. Place this behind or in front of the meter that currently has the tooltip.

Then just put any mouse actions or tooltips on this Image meter instead.

TransformationMaxtrix might look like an easy solution for "scaling" skins, but I have said before, and will say again, that there are several important "gotchas" that mean you have to take some care in how you design things so it actually works. It's not as simple as just applying a TransformationMatrix to all the meters. There are at least two issue, the first being relative positioning, and the second being mouse detection, that must be given some thought, and are not trivial to deal with.

I'm speculating a bit here, since we don't have anything approaching enough of your skin to really know what is going on. We don't even know what #Scale# is defined as...
alexbib
Posts: 3
Joined: February 17th, 2018, 2:24 am

Re: Tooltip on string meter doesn't show

Post by alexbib »

jsmorley wrote:The issue is likely the fact that TransformationMatrix does not change the mouse "target" on a meter when it is use to "scale" the size of a meter. The mouse target will remain the same size and position that the meter was before the TransformationMatrix is applied.

The solution is going to probably entail creating an Image meter with SolidColor=0,0,0,1 and a W (width) and H (height) that is also set dynamically based on the scale factor you are using. When the W and / or H is applied to the meter, then the mouse target is obviously going to be the size and shape of the meter. Place this behind or in front of the meter that currently has the tooltip.
Oh, makes sense that it's the scaling that's screwing up the mouse target. Yeah, I ended up making a transparent image target over it. Thanks for the insight!
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Tooltip on string meter doesn't show

Post by SilverAzide »

alexbib wrote:Almost all the code is scavenged from SilverAzide's Gadgets, as I'm making an extra skin to display the top processes that fits with that suite.
Alexbib, in case you are interested... https://forum.rainmeter.net/viewtopic.php?p=144903#p144903.
Post Reply