It is currently February 25th, 2020, 8:42 am

[Feature Suggestion] In-Place Tooltip

Report bugs with the Rainmeter application and suggest features.
oZone
Posts: 123
Joined: May 14th, 2018, 4:46 pm

[Feature Suggestion] In-Place Tooltip

Post by oZone »

It would be good if Rainmeter could simulate in-place tooltip behaviour, when using ClipString in string meter.

For in-place tooltip behaviour, I mean show tooltip only when string is clipped and shows (...) ellipse.
User avatar
balala
Rainmeter Sage
Posts: 9758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Feature Suggestion] In-Place Tooltip

Post by balala »

oZone wrote:
December 12th, 2019, 6:52 pm
It would be good if Rainmeter could simulate in-place tooltip behaviour, when using ClipString in string meter.

For in-place tooltip behaviour, I mean show tooltip only when string is clipped and shows (...) ellipse.
Although I don't contest that this integrated into Rainmeter would be good, however such a behavior of skins can be already simulated using the existing features:

Code: Select all

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

[Variables]
Text1=Some text to test the Tooltip feature
Text0=Some text
ClipStr=0

[MeasureWidth]
Measure=Calc
Formula=( [MeterString:W] < [MeterClipString:W] )
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!SetOption MeterString TooltipHidden "0"][!UpdateMeter "MeterString"][!Redraw]
IfFalseAction=[!SetOption MeterString TooltipHidden "1"][!UpdateMeter "MeterString"][!Redraw]
DynamicVariables=1

[StringSt]
X=0
Y=0
Padding=15,5,15,5
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
StringEffect=Shadow
AntiAlias=1
Text=[#Text[#ClipStr]]
DynamicVariables=1

[MeterString]
Meter=STRING
MeterStyle=StringSt
W=120
H=14
ClipString=1
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,150
LeftMouseUpAction=[!SetVariable ClipStr "(1-#ClipStr#)"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "MeterClipString"][!Redraw][!UpdateMeasure "MeasureWidth"]
TooltipText=[#Text[#ClipStr]]

[MeterClipString]
Meter=STRING
MeterStyle=StringSt
FontColor=220,220,220,1
FontEffectColor=0,0,0,1
SolidColor=0,0,0,1
As you can see, there are needed two String meters, with the same settings, except the size, the Clipstring and the colors of the second meter. All colors must be set to a transparency of 1 and the size (W and H options), as well as the ClipString must miss. [MeasureWidth] compares the width of the two meters and shows / hides the tooltip accordingly.
User avatar
SilverAzide
Posts: 689
Joined: March 23rd, 2015, 5:26 pm

Re: [Feature Suggestion] In-Place Tooltip

Post by SilverAzide »

oZone wrote:
December 12th, 2019, 6:52 pm
It would be good if Rainmeter could simulate in-place tooltip behaviour, when using ClipString in string meter.

For in-place tooltip behaviour, I mean show tooltip only when string is clipped and shows (...) ellipse.
I made a similar suggestion several years ago here: https://forum.rainmeter.net/viewtopic.php?f=14&t=26338&p=137560#p137560. My approach was slightly different (i.e., to have a way to know when to set a tooltip), but my use-case was the same as yours.

Recently Brian responded on a different thread, here: https://forum.rainmeter.net/viewtopic.php?f=27&t=28950&p=166735&hilit=t%3D26338#p166696. The upshot is that this is a rather complex problem.
DeviantArt Gadgets More...