It is currently April 16th, 2024, 5:40 am

Custom Tooltip Skin

Tips and Tricks from the Rainmeter Community
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Tooltip Skin

Post by Yincognito »

ms310 wrote: April 8th, 2020, 5:51 am Thank you so much!
You're welcome. I forgot to mention something in the included comments - for subsequent meters that you want to add custom tooltips, you should:
- set the PI variable to similarly subsequent numbers after you copy paste the needed MouseOverAction / MouseLeaveAction to those meters
- copy paste subsequent IfConditions in [MeasurePopulateTooltip], corresponding to the newly added PI values

It's obvious that such things should be done, but I mentioned them just in case you don't realize it.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
goeway
Posts: 21
Joined: March 20th, 2019, 8:50 pm

Re: Custom Tooltip Skin

Post by goeway »

Thank you so much!
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom Tooltip Skin

Post by Yincognito »

goeway wrote: May 17th, 2020, 11:38 pm Thank you so much!
You're welcome! In the meantime, in my skin suite, I made positioning the tooltips in a "preferred" direction possible, by replacing the IfCondition in the [MeasureMoveTooltip] from Tooltip.ini with:

Code: Select all

IfCondition=(#PP#=1) && (#TD#=1)
IfTrueAction=[!Move "(((#PX#-#MS#-#CURRENTCONFIGWIDTH#)<(#WORKAREAX#))?(#PX#+#PW#+#MS#):(#PX#-#MS#-#CURRENTCONFIGWIDTH#))" "(((#PY#+#CURRENTCONFIGHEIGHT#)>(#WORKAREAY#+#WORKAREAHEIGHT#))?(#WORKAREAY#+#WORKAREAHEIGHT#-#CURRENTCONFIGHEIGHT#):(#PY#))"][!ShowFade]
IfCondition2=(#PP#=1) && (#TD#=2)
IfTrueAction2=[!Move "(((#PX#+#CURRENTCONFIGWIDTH#)>(#WORKAREAX#+#WORKAREAWIDTH#))?(#WORKAREAX#+#WORKAREAWIDTH#-#CURRENTCONFIGWIDTH#):(#PX#))" "(((#PY#-#MS#-#CURRENTCONFIGHEIGHT#)<(#WORKAREAY#))?(#PY#+#PH#+#MS#):(#PY#-#MS#-#CURRENTCONFIGHEIGHT#))"][!ShowFade]
IfCondition3=(#PP#=1) && (#TD#=3)
IfTrueAction3=[!Move "(((#PX#+#PW#+#MS#+#CURRENTCONFIGWIDTH#)>(#WORKAREAX#+#WORKAREAWIDTH#))?(#PX#-#MS#-#CURRENTCONFIGWIDTH#):(#PX#+#PW#+#MS#))" "(((#PY#+#CURRENTCONFIGHEIGHT#)>(#WORKAREAY#+#WORKAREAHEIGHT#))?(#WORKAREAY#+#WORKAREAHEIGHT#-#CURRENTCONFIGHEIGHT#):(#PY#))"][!ShowFade]
IfCondition4=(#PP#=1) && (#TD#=4)
IfTrueAction4=[!Move "(((#PX#+#CURRENTCONFIGWIDTH#)>(#WORKAREAX#+#WORKAREAWIDTH#))?(#WORKAREAX#+#WORKAREAWIDTH#-#CURRENTCONFIGWIDTH#):(#PX#))" "(((#PY#+#PH#+#MS#+#CURRENTCONFIGHEIGHT#)>(#WORKAREAY#+#WORKAREAHEIGHT#))?(#PY#-#MS#-#CURRENTCONFIGHEIGHT#):(#PY#+#PH#+#MS#))"][!ShowFade]
IfConditionMode=1
where the TD variable name is an acronym for "tooltip direction" (1 = Left, 2 = Top, 3 = Right, 4 = Bottom, all of them relative to the hovered meter). This is by no means required, it's just a "feature" that's nice to have, assuming that the TD variable is declared and initialized somewhere in either Tooltip.ini or an .inc file used by it. In my case, I use my "settings skin" to write all these little settings in a Variables.inc that's used throughout all the skins in my suite (including Tooltip.ini):
Tooltip Settings.jpg
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
goeway
Posts: 21
Joined: March 20th, 2019, 8:50 pm

恢复:自定义工具提示外观

Post by goeway »

I added a border to it, and it looks easier to see against the complex background。。

Code: Select all

[MeterTooltipBorder]
Group=TooltipGroup
Meter=Shape
Shape=Rectangle 1, 1, ([MeterTooltipTitle:W] > [MeterTooltipText:W] ? ([MeterTooltipIcon:W]+[MeterTooltipTitle:W]) : ([MeterTooltipIcon:W]+[MeterTooltipText:W])), ([MeterTooltipTitle:H]+[MeterTooltipText:H]) | Fill Color 0,0,0,0 | StrokeWidth 1 | Stroke Color 180,180,180,255
DynamicVariables=1
User avatar
Yincognito
Rainmeter Sage
Posts: 7118
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: 恢复:自定义工具提示外观

Post by Yincognito »

goeway wrote: February 5th, 2021, 12:26 pm I added a border to it, and it looks easier to see against the complex background。。

Code: Select all

[MeterTooltipBorder]
Group=TooltipGroup
Meter=Shape
Shape=Rectangle 1, 1, ([MeterTooltipTitle:W] > [MeterTooltipText:W] ? ([MeterTooltipIcon:W]+[MeterTooltipTitle:W]) : ([MeterTooltipIcon:W]+[MeterTooltipText:W])), ([MeterTooltipTitle:H]+[MeterTooltipText:H]) | Fill Color 0,0,0,0 | StrokeWidth 1 | Stroke Color 180,180,180,255
DynamicVariables=1
Sure, good idea - anyone can design its tooltip skin the way he wants to, and for sure a border, or a different background color that's either not used or rarely used in your skins, helps. :thumbup: I didn't do it in the sample because I focused on the functionality and let the design up to the skin developer. Plus, in my skin suite (that uses tooltip skins starting with the last version), I already had a custom width bevel implemented not just in the tooltip skin, but in all skins, as it can be seen in the screenshots above. I should have probably made a thread about that as well, but I'm not sure how many users would be interested in that, considering that nowadays with the 4K monitors, the default 2 pixels of a meter's (thus, even of a skin's) BevelType option would be thin and stylish enough.

Nice addition, thanks for contributing - appreciate it. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth