It is currently July 12th, 2020, 4:16 am

Tooltip hot-spot

Report bugs with the Rainmeter application and suggest features.
User avatar
balala
Rainmeter Sage
Posts: 11009
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

Yamajac wrote:
December 12th, 2019, 7:04 pm
Drawing over top of it is just occlusion.
Yes, agree, but this is what have you said. Otherwise if the meter is hidden, then indeed tooltip isn't shown.
oZone
Posts: 133
Joined: May 14th, 2018, 4:46 pm

Re: Tooltip hot-spot

Post by oZone »

You can use ToolTipHidden option. When you show shape set ToolTipHidden=1 and when you hide it set ToolTipHidden=0.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: Tooltip hot-spot

Post by Yamajac »

balala wrote:
December 12th, 2019, 7:10 pm
Yes, agree, but this is what have you said. Otherwise if the meter is hidden, then indeed tooltip isn't shown.
That's not what I said though?

I said to hide it when you cover it so the tooltip doesn't show.
mak_kawa
Posts: 727
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Sorry for late reply. I had a few days trip, and caught a cold...too bad. :-)

So, I finally got a workaround with reference to oZone. I have added a bang to hide tooltip when mouse hovers overlaying meter. Suc as;

Code: Select all

MouseOverAction=[!SetOption MeterClickableRegion ToolTipHidden 1][!UpdateMeter MeterClickableRegion][!Redraw]
MouseLeaveAction=[!SetOption MeterClickableRegion ToolTipHidden 0][!UpdateMeter MeterClickableRegion][!Redraw]
With this workaround, my days of repose have come. :-)
User avatar
Yincognito
Posts: 1914
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

Or, if the hovered meter's coordinates and size are used instead of the skin's, one can use custom tooltips and forget about all of the OS tooltips' drawbacks...

All that's needed to "convert" a classic tooltip approach to a custom one is: a tooltip skin, the appropriate bangs added to whatever you already have in the MouseOver/MouseLeave actions, and the measure to populate the tooltip skin (where you'd simply paste the contents of the tooltip elements). If the tooltip skin and the contents of the tooltip elements (i.e. icon, title, text) already exist, the conversion process is a 30 seconds job max.
mak_kawa
Posts: 727
Joined: December 30th, 2015, 9:47 am

Re: Tooltip hot-spot

Post by mak_kawa »

Hi Yincognito

Thank you for heads-up for "custom tooltips". I too have some frustrations to the Rainmeter tooltips as you said, other than this "hot-spot" problem.
For example;
1. Annoying flickering and twitching.
2. Sometimes prevent mouse actions by the overlapped position of the tooltip when target is somewhat small.
3. For tooltip icon, we must make the image separately as *.ico file.
4. Text styles even font face/size can not be set.
5. Can't place images (except header icon) in the tooltips.
6. Appearance position is not adjustable.
7. etc..etc..

Your "custom tooltips" method may get rid of these frustrations. But honestly...it is so high hurdle for unskilled me to implement. My level of Rainmeter skill is far far different from that of you, sadly. :-)

I didn't do it yet, but hope I can try some time later.
User avatar
Yincognito
Posts: 1914
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

mak_kawa wrote:
March 14th, 2020, 12:06 am
Hi Yincognito

Thank you for heads-up for "custom tooltips". I too have some frustrations to the Rainmeter tooltips as you said, other than this "hot-spot" problem.
For example;
1. Annoying flickering and twitching.
2. Sometimes prevent mouse actions by the overlapped position of the tooltip when target is somewhat small.
3. For tooltip icon, we must make the image separately as *.ico file.
4. Text styles even font face/size can not be set.
5. Can't place images (except header icon) in the tooltips.
6. Appearance position is not adjustable.
7. etc..etc..

Your "custom tooltips" method may get rid of these frustrations. But honestly...it is so high hurdle for unskilled me to implement. My level of Rainmeter skill is far far different from that of you, sadly. :-)

I didn't do it yet, but hope I can try some time later.
My (probably) long post in the Tips & Tricks creates the impression of a high hurdle indeed. Other than that, only converting it from "skin tooltip" to "individual meter tooltip" could be considered somewhat "high hurdle", as the "skin tooltip" process is nothing complicated at all:
Rainmeter Skins Folder\Mak_Kawa\Skin\Skin.ini

Code: Select all

[Variables]
TS=0

[Rainmeter]
Update=1000
OnRefreshAction=[!SetVariable TS 0][!DeactivateConfig "#ROOTCONFIG#\Tooltip"]

[MeasurePopulateTooltip]
Measure=Calc
IfCondition=(#TS#=1)
IfTrueAction=[!SetOption MeterTooltipText Text "Test TooltipText" "#ROOTCONFIG#\Tooltip"][!UpdateMeterGroup TooltipGroup "#ROOTCONFIG#\Tooltip"][!Redraw "#ROOTCONFIG#\Tooltip"][!SetVariable PP 1 "#ROOTCONFIG#\Tooltip"][!SetVariable PX #CURRENTCONFIGX# "#ROOTCONFIG#\Tooltip"][!SetVariable PY #CURRENTCONFIGY# "#ROOTCONFIG#\Tooltip"][!SetVariable PW #CURRENTCONFIGWIDTH# "#ROOTCONFIG#\Tooltip"][!SetVariable PH #CURRENTCONFIGHEIGHT# "#ROOTCONFIG#\Tooltip"][!UpdateMeasureGroup TooltipGroup "#ROOTCONFIG#\Tooltip"]
IfConditionMode=1
DynamicVariables=1

[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]
MouseOverAction=[!SetVariable TS 1][!Delay 24][!WriteKeyValue "#ROOTCONFIG#\Tooltip" StartHidden 1 "#SETTINGSPATH#Rainmeter.ini"][!ActivateConfig "#ROOTCONFIG#\Tooltip"][!ZPos "2" "#ROOTCONFIG#\Tooltip"][!UpdateMeasure "MeasurePopulateTooltip"]
MouseLeaveAction=[!SetVariable TS 0][!DeactivateConfig "#ROOTCONFIG#\Tooltip"]
DynamicVariables=1

[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
Rainmeter Skins Folder\Mak_Kawa\Tooltip\Tooltip.ini

Code: Select all

[Variables]
MS=24
PP=0
PX=0
PY=0
PW=0
PH=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures Rainmeter---

[MeasureMoveTooltip]
Group=TooltipGroup
Measure=Calc
UpdateDivider=-1
IfCondition=(#PP#=1)
IfTrueAction=[!Move "(((#PX#+#CURRENTCONFIGWIDTH#)>(#WORKAREAX#+#WORKAREAWIDTH#))?(#PX#-(#CURRENTCONFIGWIDTH#-#PW#)):(#PX#))" "(((#PY#+#PH#+#MS#+#CURRENTCONFIGHEIGHT#)>(#WORKAREAY#+#WORKAREAHEIGHT#))?(#PY#-#MS#-#CURRENTCONFIGHEIGHT#):(#PY#+#PH#+#MS#))"][!Show]
IfConditionMode=1
DynamicVariables=1

---Styles---

[BaseStyle]
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1

---Meters---

[MeterTooltipIcon]
Group=TooltipGroup
Meter=Image
X=0
Y=0
ImageName=
UpdateDivider=-1
DynamicVariables=1

[MeterTooltipTitle]
Group=TooltipGroup
Meter=STRING
MeterStyle=BaseStyle
StringStyle=Bold
X=0
Y=0
Text=
UpdateDivider=-1
DynamicVariables=1

[MeterTooltipText]
Group=TooltipGroup
Meter=STRING
MeterStyle=BaseStyle
X=0
Y=0
Text=
UpdateDivider=-1
DynamicVariables=1
Preview
ezgif.com-video-to-gif.gif
This is just an example, based on your initial post - things can be further simplified, if needed. As you can see, apart from the Tooltip skin, which follows a pretty "standard" format that one very rarely needs to modify (I only set the X / Y positioning to absolute in this case, since you didn't have a tooltip "icon" or a "title" in your sample), the changes operated on your original code (i.e. Skin.ini) are limited to just 10 lines or so.

That being said, your workaround based on oZone's post is obviously very simple indeed, so you should probably stick to it. I only wanted to show that what you think is a "high hurdle" is neither that "high", nor that "hurdle", after all... :D
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11009
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

mak_kawa wrote:
March 14th, 2020, 12:06 am
I too have some frustrations to the Rainmeter tooltips as you said, other than this "hot-spot" problem.
For example;
1. Annoying flickering and twitching.
2. Sometimes prevent mouse actions by the overlapped position of the tooltip when target is somewhat small.
3. For tooltip icon, we must make the image separately as *.ico file.
4. Text styles even font face/size can not be set.
5. Can't place images (except header icon) in the tooltips.
6. Appearance position is not adjustable.
7. etc..etc..
As far as I can tell, there's no such thing as a "Rainmeter tooltip". Tooltip is a Windows feature used by Rainmeter and as such, Rainmeter (simply using it) can't make any settings on it. There is no way to use it any other way than how Windows handles it.
User avatar
jsmorley
Developer
Posts: 21014
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Tooltip hot-spot

Post by jsmorley »

balala wrote:
March 14th, 2020, 4:27 pm
As far as I can tell, there's no such thing as a "Rainmeter tooltip". Tooltip is a Windows feature used by Rainmeter and as such, Rainmeter (simply using it) can't make any settings on it. There is no way to use it any other way than how Windows handles it.
Correct. The advantage to using the ToolTip function built-into Rainmeter is that it allows Windows to do all the work of deciding where to display the tooltip, which would be a fair amount of work to dynamically get right, as well as the relative simplicity of using it. The downside is that there are indeed limited opportunities for customization. Just what Windows supports in the API, which is limited by design, as they have as much or more of an interest in standardizing how tooltips look and work in Windows as they do in giving you flexibility.

Feel free to write your own using a separate skin or some meters in the current skin as you like. I don't doubt some interesting things could be done with a little thought and work. But if you want the simplicity of ToolTip, you have to live with the limitations.

The biggest challenge, although certainly doable, is to get the tooltip to display at the right point relative to the mouse cursor, while making sure that it doesn't go off the screen in any direction. Also something to work on is to have the tooltip move with the mouse cursor in real-time. Going to be tough unless you set a really low Update rate or maybe use one of the mouse plugins. Then you have to decide and code for some kind of "timeout", unless you want to just use a brute-force "mouse over / mouse off" approach.

With all the cosmetic limitations of the tooltip in Windows, it is actually pretty clever, and would not be entirely trivial to replicate in all aspects.
User avatar
Yincognito
Posts: 1914
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

jsmorley wrote:
March 14th, 2020, 4:56 pm
Correct. The advantage to using the ToolTip function built-into Rainmeter is that it allows Windows to do all the work of deciding where to display the tooltip, which would be a fair amount of work to dynamically get right, as well as the relative simplicity of using it. The downside is that there are indeed limited opportunities for customization. Just what Windows supports in the API, which is limited by design, as they have as much or more of an interest in standardizing how tooltips look and work in Windows as they do in giving you flexibility.
Precisely. Having the OS worry about positioning and displaying tooltips is a pretty good argument for using them, along with their simplicity. Although I'm not sure how much tooltips will live in the age of smartphones and "mobile standardization"...
jsmorley wrote:
March 14th, 2020, 4:56 pm
Feel free to write your own using a separate skin or some meters in the current skin as you like. I don't doubt some interesting things could be done with a little thought and work. But if you want the simplicity of ToolTip, you have to live with the limitations.

The biggest challenge, although certainly doable, is to get the tooltip to display at the right point relative to the mouse cursor, while making sure that it doesn't go off the screen in any direction. Also something to work on is to have the tooltip move with the mouse cursor in real-time. Going to be tough unless you set a really low Update rate or maybe use one of the mouse plugins. Then you have to decide and code for some kind of "timeout", unless you want to just use a brute-force "mouse over / mouse off" approach.

With all the cosmetic limitations of the tooltip in Windows, it is actually pretty clever, and would not be entirely trivial to replicate in all aspects.
All these challenges (e.g. positioning, general relativity to the tooltip "parent") have already been solved in my implementation, except for displaying the tooltip relative to mouse cursor. While the latter would be entirely doable if Rainmeter would have a $MouseX$ and $MouseY$ that react not only on click/scroll but also on hover, it's not that big of a deal to have this "feature" missing. Positioning the tooltip relative to the "parent" skin or meter, while not as precise as relativity to the mouse cursor, is something one can live with, assuming the padding around the text / element that trigger the tooltip isn't exaggerate.

Moving with the mouse cursor (or with the parent skin or meter, in the current circumstances) doesn't require a low update rate at all ... for the simple reason that not even the OS tooltips do that (and when they do, they're no good anyway, due to constant flickering). A one second update of moving with the reference point (i.e. cursor/skin/meter) is totally reasonable, unless you really want to make the tooltip unusable either due to flickering (OS tooltips) or higher CPU usage (custom tooltips). Below is a 24 ms updated custom tooltip moving with the parent skin. It doesn't flicker like the OS tooltips, but it does use the CPU more (from 0.39/0.78/1.15 % to 20%):
ezgif.com-optimize.gif
P.S. Yes, my entire skin suite - including the 2 sliding text "marquee" skins - take just 0.39 to 0.78 % CPU normally.
You do not have the required permissions to view the files attached to this post.