It is currently March 29th, 2024, 12:11 am

Tooltip hot-spot

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

Re: Tooltip hot-spot

Post by mak_kawa »

Hi balala, jsmorley and Yincongnito

Yes, I have realized in my long history of the forum reading that the tooltip in Rainmeter is in fact achieved by Windows function called from Rainmeter. I expressed it as "Rainmeter tooltips" in short words. I apologize for my lame expression.

Of the tooltip in Rainmeter with TooltipType=1, its balloon is automatically flipped horizontaly/vertically due to its position in screen. Probably it is really difficult for me to make tooltip skin with such function. I would try later, if I can. :-)
Last edited by mak_kawa on March 15th, 2020, 11:15 am, edited 1 time in total.
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: March 14th, 2020, 4:56 pm 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
In my opinion, this is not a disadvantage. Just the opposite: this has the advantage of having similarly looking tooltips over all Windows applications.
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.
Well, me personally really doubt. Don't doubt about some really good looking and interesting solutions could come up, but this definitely doesn't worth. Because using the standard tooltip requires one single option on an already existing meter. Can anything be simpler than this? Well, this is what I really doubt. So, worth living with the limitations...
jsmorley wrote: March 14th, 2020, 4:56 pm 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.
And should have to use a low Update, or a plugin, beside a lot of meters and maybe even some measures and so on.
Again: does all this worth?
And again: I really doubt...
My opinion...
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: March 15th, 2020, 1:32 am Of the tooltip in Rainmeter with TooltipType=1, its baloon is automatically flipped horizontaly/vertically due to its position in screen. Probably it is really difficult for me to make tooltip skin with such function. I would try later, if I can. :-)
Don't contest it is possible, but definitely isn't easy, nor short. Definitely not so short as adding one (or a few, up to let's say five) options to a meter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

balala wrote: March 15th, 2020, 10:02 amWell, me personally really doubt. Don't doubt about some really good looking and interesting solutions could come up, but this definitely doesn't worth. Because using the standard tooltip requires one single option on an already existing meter. Can anything be simpler than this? Well, this is what I really doubt. So, worth living with the limitations...
Not really. Standard tooltips require between 1 and 5 options on a meter (i.e. 1 if you only need tooltip text, more than 1 if you also need a tooltip title, icon, a different type or a maximum width). By comparison, if we're talking exclusively about the said meter, using custom tooltips always requires 2 options (i.e. the bangs in the MouseOver and MouseLeave actions). Sure, there are other options needed in other places in the skin, but the vast majority of them are just copy paste options that don't change at all. The only thing that changes in the case of custom tooltips is, just like in the case of standard tooltips, the content of title/text/icon or whatever elements one has in the tooltips. That's all - I took care of the rest.

To be clear, I'm not trying to say that people should use custom tooltips from now on, I'm just clarifying the misconception that you need to have lots of things changed to use them. That is simply FALSE, period.
balala wrote: March 15th, 2020, 10:02 amAnd should have to use a low Update, or a plugin, beside a lot of meters and maybe even some measures and so on.
Again: does all this worth?
And again: I really doubt...
My opinion...
To get the tooltip to display at the right point relative to the mouse cursor, a suitable plugin is for sure required, on that I agree. But not "a lot of meters and maybe even some measures and so on". Again, this is downright FALSE. Check this plugin here: you'd only need 2 measures to get the mouse cursor's X and Y, and then setting the PX and PY variables in the parent skin's [MeasurePopulateTooltip] to the number value of those measures, instead of the #CURRENTCONFIGX# and #CURRENTCONFIGY# like they are now, and also PW and PY to 0. And again, a low update rate is not required - most people would be totally fine with having the tooltip's position update once a second on movement, especially considering the drawbacks if you choose a lower update rate. Those drawbacks are similar for standard and custom tooltips, by the way - it's not like only custom tooltips would have to "suffer" if you set a low update rate. In fact, the main reason why I designed the custom tooltips is exactly that: to avoid the parent skin's (potential) low update rate (in the case of animated skin) to "propagate" to the tooltip as well. And I've managed that, even better than I expected.

P.S. You should really try my sample in this previous post to see how simple things are, because I have the feeling that you said what you said without even taking a look at it (otherwise you wouldn't have said it, obviously)... :D
Last edited by Yincognito on March 15th, 2020, 1:19 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

balala wrote: March 15th, 2020, 10:06 am Don't contest it is possible, but definitely isn't easy, nor short. Definitely not so short as adding one (or a few, up to let's say five) options to a meter.
Are you sure about this? Cause as far as I can see, a simple triangular shape "joined" to the "default" rectangular shape of the skin would be enough to simulate the baloon's "pointing arrow". As for its position, it would be just a matter of adapting the already existing formula for tooltip movement:

Code: Select all

(((#PX#+#CURRENTCONFIGWIDTH#)>(#WORKAREAX#+#WORKAREAWIDTH#))?(#PX#-(#CURRENTCONFIGWIDTH#-#PW#)):(#PX#))

Code: Select all

(((#PY#+#PH#+#MS#+#CURRENTCONFIGHEIGHT#)>(#WORKAREAY#+#WORKAREAHEIGHT#))?(#PY#-#MS#-#CURRENTCONFIGHEIGHT#):(#PY#+#PH#+#MS#))
These already position the tooltip skin to fit the screen's "work area". The baloon's "pointing arrow" would be joined on the opposite side of the movement direction (e.g. if the tooltip is below the parent skin, the arrow would be joined at the top of the tooltip, if the tooltip is at the right of the parent skin, the arrow would be joined at the left of the tooltip, and so on).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

Yincognito wrote: March 15th, 2020, 12:33 pm P.S. You should really try my sample in this previous post to see how simple things are, because I have the feeling that you said what you said without even taking a look at it (otherwise you wouldn't have said it, obviously)... :D
I did. And first time I loaded the skin, I faced with a big difference between your tooltip and the Windows tooltip. If you're moving the mouse over the circle, your tooltip doesn't move, not following the mouse continuosly changing position, while the "real" Windows tooltip does:
GIF.gif
Additionally note that the Tooltip\Tooltip.ini skin (which has the code of the tooltip plus the additional icon, title and so on) has 66 lines, plus the options needed to be added into the main skin. This is much more than the up to 5 (or so) options needed for a "classic" tooltip, isn't it?
Yes, I don't contest your tooltip is much easier customizable than the real tooltip. But as said above, it still has disadvantages, which should be fixed.
Sorry, you didn't convinced me. I don't want to say your approach is not looking good, is not useful or whatever. But it's not something which has the same functions as the Windows tooltip. That would be hard enough to be replicate by Rainmeter code.
You do not have the required permissions to view the files attached to this post.
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 »

I tend to stay away from tooltips myself, as I'm not in love with the limitations and behavior of the baked-in Windows tooltips, and I personally find that trying to roll my own quickly becomes more work than it is worth. I find that for my needs, it can be more satisfying to have some panel with additional information "slide-in" on mouse over. The new Container functionality, combined with ActionTimer, is nice for that.

But it depends on what you are going for with your design. A tooltip is certainly a nice, simple way to have something like "click here" or "click this for settings" or something pop up. That is sorta the point of tooltips in Windows. They never really intended for it to be used to display a lot of real-time information, and to be honest, it's not really that great for that. I think of tooltips as a "hint".



test1.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

balala wrote: March 15th, 2020, 1:40 pmI did. And first time I loaded the skin, I faced with a big difference between your tooltip and the Windows tooltip. If you're moving the mouse over the circle, your tooltip doesn't move, not following the mouse continuosly changing position, while the "real" Windows tooltip does.
We had this type of conversation about "big differences" that are "hard to overcome" in another thread, and I proved there too that they are not. I'll make that attempt one more time here, in the hope that you'll learn from it.

First, of course the tooltip doesn't follow the mouse cursor. Duh! Didn't you read what I replied to jsmorley yet? Rainmeter DOES NOT have a $MouseX$ and $MouseY$ that react not only on click/scroll but also on hover, so if you blame it on something, blame it on the Rainmeter's set of features and not on my approach. That being said, I just mentioned in my previous post that with a plugin to get mouse cursor's X and Y, that behavior is entirely possible (and if you set MeasurePopulateTooltip's update rate to a couple of dozens of milliseconds, you'll get the "realtime" effect as well). The only actual modifications needed are the 2 measures to get mouse cursor's X and Y from the plugin, and assigning them to the PX and PY variables couple with setting the PW and PH variables to 0 in the measure that populated the tooltip (of course, you'd say that these little things are "hard" to do, LMAO):

Skin.ini

Code: Select all

[Variables]
TS=0

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

[MeasureMouseX]
Measure=Plugin
Plugin=MouseXY
Dimension=X
MaxValue=#SCREENAREAWIDTH#

[MeasureMouseY]
Measure=Plugin
Plugin=MouseXY
Dimension=Y
MaxValue=#SCREENAREAHEIGHT#

[MeasurePopulateTooltip]
Measure=Calc
IfCondition=(#TS#=1)
IfTrueAction=[!SetOption MT_Rainmeter_TooltipIcon ImageName "" "#ROOTCONFIG#\Tooltip"][!SetOption MT_Rainmeter_TooltipTitle Text "" "#ROOTCONFIG#\Tooltip"][!SetOption MeterTooltipText Text "Test TooltipText" "#ROOTCONFIG#\Tooltip"][!UpdateMeterGroup TooltipGroup "#ROOTCONFIG#\Tooltip"][!Redraw "#ROOTCONFIG#\Tooltip"][!SetVariable PP 1 "#ROOTCONFIG#\Tooltip"][!SetVariable PX [MeasureMouseX:] "#ROOTCONFIG#\Tooltip"][!SetVariable PY [MeasureMouseY:] "#ROOTCONFIG#\Tooltip"][!SetVariable PW 0 "#ROOTCONFIG#\Tooltip"][!SetVariable PH 0 "#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
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=2,0,2,0
AntiAlias=1

---Meters---

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

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

[MeterTooltipText]
Group=TooltipGroup
Meter=STRING
MeterStyle=BaseStyle
X=0r
Y=0R
Text=
UpdateDivider=-1
DynamicVariables=1
Proof:
ezgif.com-video-to-gif.gif
balala wrote: March 15th, 2020, 1:40 pmAdditionally note that the Tooltip\Tooltip.ini skin (which has the code of the tooltip plus the additional icon, title and so on) has 66 lines, plus the options needed to be added into the main skin. This is much more than the up to 5 (or so) options needed for a "classic" tooltip, isn't it?
As I already said, the code in Tooltip.ini skin is just a matter of copy paste, it doesn't have to be modified at all (I did that, compared to the sample in Tips and Tricks, but it isn't really necessary). If you find it hard to paste that code in an .ini file, well ... I'm not sure what to say. That has to be the easiest thing one can do in front of a computer, other than just staring at it...
balala wrote: March 15th, 2020, 1:40 pmYes, I don't contest your tooltip is much easier customizable than the real tooltip. But as said above, it still has disadvantages, which should be fixed.
Disadvantages that should be fixed? LOL, that's absurd. Only bugs need to be fixed, you can't fix disadvantages, since everything in this world has advantages and disadvantages, you can't have it any other way. The standard tooltips have them, so do the custom ones. What I did is make sure that the latter have as few disadvantages as possible - and so far the only disadvantage is that you have to copy paste a couple of lines here and there. My god, what a big disadvantage... :rofl:
balala wrote: March 15th, 2020, 1:40 pmSorry, you didn't convinced me. I don't want to say your approach is not looking good, is not useful or whatever. But it's not something which has the same functions as the Windows tooltip. That would be hard enough to be replicate by Rainmeter code.
I don't want to convince you. I know that's a difficult thing to do, and not because my approach is hard, but because you keep bringing various reasons why this and that are "hard to replicate" and such.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Tooltip hot-spot

Post by balala »

Yincognito wrote: March 15th, 2020, 2:42 pm We had this type of conversation about "big differences" that are "hard to overcome" in another thread, and I proved there too that they are not. I'll make that attempt one more time here, in the hope that you'll learn from it.
Finally probably everyone is free to use whatever approach he wants. I'm also using one which matches my needs. You didn't convinced me, but this is my problem.
End of discussion, from my point of view. I can't BUT DON'T EVEN WANT to convince you Tooltip is anyway better (or anything else).
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Tooltip hot-spot

Post by Yincognito »

jsmorley wrote: March 15th, 2020, 1:56 pm I tend to stay away from tooltips myself, as I'm not in love with the limitations and behavior of the baked-in Windows tooltips, and I personally find that trying to roll my own quickly becomes more work than it is worth. I find that for my needs, it can be more satisfying to have some panel with additional information "slide-in" on mouse over. The new Container functionality, combined with ActionTimer, is nice for that.
So, isn't the amount of code required for that "sliding panel" comparable to the amount of code required for my custom tooltip approach? I'm not talking about things one can just copy paste, but about the code that's (often) subject to change.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth