It is currently April 23rd, 2024, 3:55 pm

How to remove a space before a value, in a tooltip?

Get help with installing and using Rainmeter.
jn_meter
Posts: 136
Joined: December 27th, 2016, 12:04 pm

How to remove a space before a value, in a tooltip?

Post by jn_meter »

I'm using Rainmeter 4.4.0.3349 beta.

I have a skin that that has a meter within which is, among other things, this:

Code: Select all

MeasureName=measure_disk_used_percent_c
Meter=String
MeterStyle=style_value_disk_used
Text=%1%
ToolTipText=%1% ([measure_disk_used_c_gb]GB) used of [measure_disk_total_gb_c] GB; [measure_disk_free_gb_c] GB free
The tooltip text show as e.g.
10 % 124GB of [etc.]
Why the space before the percentage sign? How can I get rid of that space?

Thanks and apologies if I overlook something obvious.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to remove a space before a value, in a tooltip?

Post by jsmorley »

jn_meter wrote: May 13th, 2020, 8:57 pm I'm using Rainmeter 4.4.0.3349 beta.

I have a skin that that has a meter within which is, among other things, this:

Code: Select all

MeasureName=measure_disk_used_percent_c
Meter=String
MeterStyle=style_value_disk_used
Text=%1%
ToolTipText=%1% ([measure_disk_used_c_gb]GB) used of [measure_disk_total_gb_c] GB; [measure_disk_free_gb_c] GB free
The tooltip text show as e.g.


Why the space before the percentage sign? How can I get rid of that space?

Thanks and apologies if I overlook something obvious.
In this case the issue is going to be related to the measure somehow, can you post that?
jn_meter
Posts: 136
Joined: December 27th, 2016, 12:04 pm

Re: How to remove a space before a value, in a tooltip?

Post by jn_meter »

Thank you. Certainly. However, multiple measures are involved. Here are all of them (but not everything they pull in).

Code: Select all

[measure_disk_used_percent_c]
Measure=CALC
Formula=Round(measure_disk_usedFraction_c * 100, 1)
UpdateDivider=#updateMulti_discSpace_base#

[measure_disk_usedFraction_c]
Measure=CALC
Formula=measure_disk_used_c / measure_disk_total_c
UpdateDivider=#updateMulti_discSpace_base#
IfCondition=measure_disk_usedFraction_c < 0.7
IfTrueAction=[!SetOption meter_value_c MeterStyle style_value_low]
IfCondition2=(measure_disk_usedFraction_c >= 0.7) && (measure_disk_used_percent_c < 0.9)
IfTrueAction2=[!SetOption meter_value_c MeterStyle style_value_medium]
IfCondition3=measure_disk_usedFraction_c >= 0.9
IfTrueAction3=[!SetOption meter_value_c MeterStyle style_value_high]

[measure_disk_used_c_GB]
Measure=CALC
Formula=round(measure_disk_used_c / 1073741824, 1)
UpdateDivider=#updateMulti_discSpace_base#

[measure_disk_total_c]
Measure=FreeDiskSpace
Drive=C:
Total=1
UpdateDivider=#updateMulti_discTotalSize#
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to remove a space before a value, in a tooltip?

Post by jsmorley »

Can I see the MeterStyles style_value_medium and such as well?
jn_meter
Posts: 136
Joined: December 27th, 2016, 12:04 pm

Re: How to remove a space before a value, in a tooltip?

Post by jn_meter »

Code: Select all

[style_value_low]
AntiAlias=1
FontColor=#col_green_light#
FontWeight=600
FontFace=#font_forValues#
FontSize=#font_size_value#
H=30
SolidColor=#col_bg_ForValue#
StringAlign=RIGHT
StringCase=NONE
StringEffect=BORDER
Y=#y_pos#

[style_value_medium]
AntiAlias=1
FontColor=#col_yellowGreen#
FontWeight=600
FontFace=#font_forValues#
FontSize=#font_size_value#
H=30
SolidColor=#col_bg_ForValue#
StringAlign=RIGHT
StringCase=NONE
StringEffect=BORDER
Y=#y_pos#

[style_value_high]
AntiAlias=1
FontColor=#col_red#
FontWeight=700
FontFace=#font_forValues#
FontSize=#font_size_value#
H=30
SolidColor=#col_bg_ForValue#
StringAlign=RIGHT
StringCase=NONE
StringEffect=BORDER
Y=#y_pos#
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to remove a space before a value, in a tooltip?

Post by jsmorley »

Huh. Well I don't see where it is happening right off...
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to remove a space before a value, in a tooltip?

Post by balala »

jsmorley wrote: May 14th, 2020, 12:02 am Huh. Well I don't see where it is happening right off...
Same here. But a comment I'd have in any case to jn_meter.
Could you jn_meter post the whole code, please? Don' wait for us to figure out what you have there, because there might be some parts of the code which in some cases counts, but we don't have them. So again, post please the whole code, from its beginning to its end.
Help us to help you, please.
User avatar
Yincognito
Rainmeter Sage
Posts: 7149
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to remove a space before a value, in a tooltip?

Post by Yincognito »

jn_meter wrote: May 13th, 2020, 8:57 pmI have a skin that that has a meter within which is, among other things, this:

Code: Select all

MeasureName=measure_disk_used_percent_c
Meter=String
MeterStyle=style_value_disk_used
Text=%1%
ToolTipText=%1% ([measure_disk_used_c_gb]GB) used of [measure_disk_total_gb_c] GB; [measure_disk_free_gb_c] GB free
The tooltip text show as e.g. 10 % 124GB of [etc.]

Why the space before the percentage sign? How can I get rid of that space?

Thanks and apologies if I overlook something obvious.
jsmorley wrote: May 14th, 2020, 12:02 am Huh. Well I don't see where it is happening right off...
balala wrote: May 14th, 2020, 8:26 amSame here.
Might be because of the formatting options forced on tooltip texts (i.e. NumOfDecimals=0, possibly even Percentual=0). If things display correctly in the meter itself (where there is also a Text=%1%), then the tooltip formatting options is likely "the culprit" for this, especially since in [measure_disk_used_percent_c] a rounding of the value to a decimal precision of 1 (not 0, as forced in tooltips) is performed.

The solution might be to use section variables instead. I know I always do, in these cases. Something like [measure_disk_used_percent_c:1] in the TooltipText option and adding DynamicVariables=1 to the original meter.

Let us know if this solves the issue.
While in many cases useful, the whole skin code isn't necessarily required every time. Just my humble observation, ignore it if you feel otherwise. :confused:
EDIT: Just tested, this is definitely the culprit. Also, make sure you set NumOfDecimals=1 in the meter, as the value will be rounded to a decimal precision of 0 (the default) even in the meter itself, if the aforementioned option is not present.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
jn_meter
Posts: 136
Joined: December 27th, 2016, 12:04 pm

Re: How to remove a space before a value, in a tooltip?

Post by jn_meter »

Solved. Thank you very much for your work and advice.

I had some trouble understanding your reply, but on the other hand I gave you a mess to work with.

I got things working properly by doing the following.

1) I used this format for my ToolTipText lines:

Code: Select all

ToolTipText=[measure_disk_used_percent_y:1]% used ([measure_disk_used_y_gb] GB of [measure_disk_total_y_gb] GB); [measure_disk_free_y_gb] GB free
The ':1' tells Rainmeter to give a value to one decimal place.

2) I fixed some problems with my variables (that my linter did not pick up). I was referring to some variables that did not exist - for, I had got confused by my own naming scheme for variables (and in more than one way!).
User avatar
Yincognito
Rainmeter Sage
Posts: 7149
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to remove a space before a value, in a tooltip?

Post by Yincognito »

jn_meter wrote: May 14th, 2020, 11:49 amSolved. Thank you very much for your work and advice.
You're welcome.
jn_meter wrote: May 14th, 2020, 11:49 amI had some trouble understanding your reply, but on the other hand I gave you a mess to work with.
If you're talking about my reply, would you care to explain a bit what was difficult to understand? So that I can make amends, if necessary, you know.
I know that sometimes I overcomplicate things when explaining (and a short reply becomes a longer one), but that's just because I like to cover all possibilities.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth