It is currently March 29th, 2024, 5:06 am

[Feature Suggestion] In-Place Tooltip

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Suggestion] In-Place Tooltip

Post by Yincognito »

balala wrote: March 12th, 2020, 6:53 pm Not sure what should I see on this code. What should I?
Well, you said my approach wasn't suitable for WebParser cases, and I just proved it is, that's all. But more importantly, the small fixes (sorry, I probably wasn't paying attention to the TRUE/FALSE value of the expression) solve the problem you mentioned. So yes, it can be done without using two meters and transparency...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Feature Suggestion] In-Place Tooltip

Post by balala »

Yincognito wrote: March 12th, 2020, 6:58 pm Well, you said my approach wasn't suitable for WebParser cases, and I just proved it is, that's all. But more importantly, the small fixes (sorry, I probably wasn't paying attention to the TRUE/FALSE value of the expression) solve the problem you mentioned. So yes, it can be done without using two meters and transparency...
To be honest still don't know what that code proves...
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Suggestion] In-Place Tooltip

Post by Yincognito »

You said, and I quote:
balala wrote: March 12th, 2020, 5:13 pm[...] but what if the string is returned for instance by a WebParser measure, and you don't know it (or its width) when you write the code of the skin? I think in such a case using the two String meters (as suggested above) is the only possibility, at least with the current features of Rainmeter.
and I said:
Yincognito wrote: March 12th, 2020, 6:58 pmWell, you said my approach wasn't suitable for WebParser cases, and I just proved it is, that's all.
Now you understand what my code proves? :D You said your way is the only way to achieve what the OP wanted. I proved that it can be done much easier, without needing another string meter and transparency. Of course, I was a bit derailed by the bug I discovered in my code in the meantime, but that has been fixed now and my original statement still stands.

That being said, you still didn't say if my code works as expected now (i.e. after fixing the bug)... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Feature Suggestion] In-Place Tooltip

Post by balala »

Yincognito wrote: March 12th, 2020, 7:20 pm That being said, you still didn't say if my code works as expected now (i.e. after fixing the bug)... :D
Yes, it does.
But even if too late, I figured out about a big difference between the two codes. In my code the visible String meter has a well set width (W=120 on [MeterString]). The meter clips the string if its longer then this and in this case it shows the Tooltip when hovering the mouse over. In your code on the other hand, the ClipStringW option specifies the maximum width to which the meter can expand to without showing the Tooltip, so its width varies, depending on the string, while mine has a constant width.
In your case the one single String meter is enough, but if the meter has set a well defined width, the two meters are needed. But this are different cases, so we are not exactly talking about the same thing.
As usually, the question has more (much or less the same) solutions.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Suggestion] In-Place Tooltip

Post by Yincognito »

balala wrote: March 12th, 2020, 9:22 pmYes, it does.
Good - thanks for letting me know. Sorry for my initial lack of attention that produced the "malfunction" you noticed. I was already working on the fix when having the discussion with you (even before you mentioned the malfunction), but I would have never discovered the "bug" if I wasn't set to prove that the WebParser scenario works in the first place. Basically, I discovered the mistake in my code because I was preparing the WebParser version for you. ;-)
balala wrote: March 12th, 2020, 9:22 pm[...] so its width varies, depending on the string, while mine has a constant width.
Yep, I know. The variable width has an important role in my implementation, since it effectively "measures" the width of the string itself (so that it can be compared with the clipping limit). But...
balala wrote: March 12th, 2020, 9:22 pmIn your case the one single String meter is enough, but if the meter has set a well defined width, the two meters are needed. But this are different cases, so we are not exactly talking about the same thing.
I know you care about your two meters approach on this, balala (and I can understand it), but again, the two meters version is not necessarily needed, even if you want a "defined width". For example, if you set W=120 on the meter from in my last posted code and also modify the below option(s) with:

- in the "regular sample":

Code: Select all

LeftMouseUpAction=[!SetOption #CURRENTSECTION# W ""][!UpdateMeasure MeasureString][!UpdateMeter #CURRENTSECTION#][!SetOption #CURRENTSECTION# TooltipHidden ([#CURRENTSECTION#:W]<120)][!SetOption #CURRENTSECTION# W 120][!UpdateMeter #CURRENTSECTION#][!Redraw]
- or in the "WebParser sample":

Code: Select all

FinishAction=[!SetOption MeterObservationPhrase W ""][!UpdateMeasure MeasureObservationPhrase][!UpdateMeter MeterObservationPhrase][!SetOption MeterObservationPhrase ToolTipHidden ([MeterObservationPhrase:W]<120)][!SetOption MeterObservationPhrase W 120][!UpdateMeter MeterObservationPhrase][!Redraw]
then you have the desired "defined width" (i.e. 120, in this case) in my implementation as well. This takes advantage of the Rainmeter's ability to remove an option from a measure or meter (then setting it back again, after manipulating the ToolTipHidden option).

Preview (notice that the width of the meter's black "box" stays constant)
ezgif.com-video-to-gif.gif
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: [Feature Suggestion] In-Place Tooltip

Post by balala »

Yincognito wrote: March 12th, 2020, 10:31 pm I know you care about your two meters approach on this, balala (and I can understand it), but again, the two meters version is not necessarily needed, even if you want a "defined width". For example, if you set W=120 on the meter from in my last posted code and also modify the below option(s) with:

- in the "regular sample":

Code: Select all

LeftMouseUpAction=[!SetOption #CURRENTSECTION# W ""][!UpdateMeasure MeasureString][!UpdateMeter #CURRENTSECTION#][!SetOption #CURRENTSECTION# TooltipHidden ([#CURRENTSECTION#:W]<120)][!SetOption #CURRENTSECTION# W 120][!UpdateMeter #CURRENTSECTION#][!Redraw]
- or in the "WebParser sample":

Code: Select all

FinishAction=[!SetOption MeterObservationPhrase W ""][!UpdateMeasure MeasureObservationPhrase][!UpdateMeter MeterObservationPhrase][!SetOption MeterObservationPhrase ToolTipHidden ([MeterObservationPhrase:W]<120)][!SetOption MeterObservationPhrase W 120][!UpdateMeter MeterObservationPhrase][!Redraw]
then you have the desired "defined width" (i.e. 120, in this case) in my implementation as well. This takes advantage of the Rainmeter's ability to remove an option from a measure or meter (then setting it back again, after manipulating the ToolTipHidden option).
No, I don't care too much, but I thought it's not possible without the second meter, if the "main" one has a defined width. But yep, your idea is extremely interesting, as said, I didn't think to it before.
Good, congratulations. :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Suggestion] In-Place Tooltip

Post by Yincognito »

balala wrote: March 13th, 2020, 8:46 am No, I don't care too much, but I thought it's not possible without the second meter, if the "main" one has a defined width. But yep, your idea is extremely interesting, as said, I didn't think to it before.
Good, congratulations. :thumbup:
Yeah, its only drawback is that you can't place these bangs in an OnUpdateAction in the respective meter, since it would lead to an endless update cycle that would crash Rainmeter. As long as the bangs are placed in a different action option in the same meter or in a different meter though, everything works just fine. In the end, I suppose that creating another, specific meter where you set these things for all the other meters you need to is going to be required, but at least it's 1 meter for all the others, and not 1 meter for each of the others, so I guess it's still better this way, having less code to write.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Feature Suggestion] In-Place Tooltip

Post by balala »

Yincognito wrote: March 13th, 2020, 10:18 am Yeah, its only drawback is that you can't place these bangs in an OnUpdateAction in the respective meter,
But why would you want to place those bangs into the OnUpdateAction option?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Feature Suggestion] In-Place Tooltip

Post by Yincognito »

balala wrote: March 13th, 2020, 10:38 am But why would you want to place those bangs into the OnUpdateAction option?
Well, in general, OnUpdateAction is a useful option that you can attach to any measure or meter, without altering the already existing behavior of the skin (by comparison, putting stuff in a Mouse action involves some change on how the skin behaves, especially if you don't use mouse actions for other things). In other words, it's a convenient place to put stuff, that's all.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Feature Suggestion] In-Place Tooltip

Post by balala »

Yincognito wrote: March 13th, 2020, 1:58 pm In other words, it's a convenient place to put stuff, that's all.
Yeah, but in this case, as yourself said, it creates an endless loop, crashing the whole Rainmeter. Very inconvenient!