It is currently March 29th, 2024, 8:58 am

ToolTip Scaling

Get help with creating, editing & fixing problems with skins
DuckSlaps
Posts: 5
Joined: June 18th, 2020, 10:05 pm

ToolTip Scaling

Post by DuckSlaps »

I'm trying to scale Recycle Bin information for a tool tip popup on mouse over. I found a previous posting here with a potential fix, but I can't get the code to work for me.
Currently my code is:

Code: Select all

[MeasureRecycleBin]
;This measures number of items in bin
Measure=Plugin
Plugin=RecycleManager.dll
Drives=ALL
RecycleType=COUNT
IfCondition=measureRecycleBin = 1
IfTrueAction=[!SetVariable CountText "Item"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetVariable CountText "Items"[!UpdateMeter *[!Redraw]

[MeasureRecycleBinSize]
;This measures size of items in bin
Measure=Plugin
Plugin=RecycleManager.dll
Drives=ALL
RecycleType=SIZE
IfCondition=measureBinSize < 1024
IfTrueAction=[!SetVariable Scale "1"][!SetVariable ScalePostfix ""][!SetVariable Decimals "0"][!UpdateMeter *][!Redraw]
IfCondition2=(measureBinSize >= 1024) && (measureBinSize < 1048576)
IfTrueAction2=[!SetVariable Scale "1024"][!SetVariable ScalePostfix "k"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]
IfCondition3=(measureBinSize >= 1048576) && (measureBinSize < 1073741824)
IfTrueAction3=[!SetVariable Scale "1048576"][!SetVariable ScalePostfix "M"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]
IfCondition4=measureBinSize >= 1073741824
IfTrueAction4=[!SetVariable Scale "1073741824"][!SetVariable ScalePostfix "G"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]

[MeasureRecycleBinAction]
Measure=Calc
Formula=MeasureRecycleBin
IfAboveAction=[!RainmeterHideMeter MeterEmpty][!RainmeterShowMeter MeterFull]
IfAboveValue=0
IfEqualAction=[!RainmeterHideMeter MeterFull][!RainmeterShowMeter MeterEmpty]
IfEqualValue=0

;===================================
;===================================

[MeterEmpty]
Meter=Image
DynamicVariables=1
ImageName=#@#Icons/Trash outline.png
H=70
AntiAlias=1
LeftMouseUpAction=[shell:RecycleBinFolder]
RightMouseUpAction=[!PluginBang "MeasureRecycleBin EmptyBin"][!Redraw]
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#icons\trash color.png][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#icons\trash outline.png][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
ToolTipType=1
ToolTipTitle="Recycle Bin"
ToolTipText="[MeasureRecycleBin] #CountText#,#CRLF#[MeasureRecycleBinSize:/#Scale#, #Decimals#] #ScalePostfix#B"

[MeterFull]
Meter=Image
DynamicVariables=1
ImageName=#@#Icons/Trash full outline.png
H=70
AntiAlias=1
LeftMouseUpAction=[shell:RecycleBinFolder]
RightMouseUpAction=[!PluginBang "MeasureRecycleBin EmptyBin"][!Redraw]
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#icons\trash full color.png][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#icons\trash full outline.png][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
ToolTipType=1
ToolTipTitle="Recycle Bin"
ToolTipText="[MeasureRecycleBin] #CountText#,#CRLF#[MeasureRecycleBinSize:/#Scale#, #Decimals#] #ScalePostfix#B"
It's an amalgamation of code I was able to sort of teach myself from the previous post here (https://forum.rainmeter.net/viewtopic.php?t=19144) and a recycle bin skin i found on DeviantArt here (https://www.deviantart.com/hiphopium/art/Mond-762455575) which I used as a guide in attempting to write my own skin.

Even with the help from the linked post, my tooltip is not scaling, as seen here (https://imgur.com/a/l5Cbb8V)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: ToolTip Scaling

Post by eclectic-tech »

If you check the Rainmeter log, you will see this error:
"measureBinSize" is unknown: IfCondition=measureBinSize < 1024
...

You named this section [MeasureRecycleBinSize], so change the IfCondition test to test this name in all 4 checks.

Code: Select all

...

[MeasureRecycleBinSize]
;This measures size of items in bin
Measure=Plugin
Plugin=RecycleManager.dll
Drives=ALL
RecycleType=SIZE
IfCondition=MeasureRecycleBinSize < 1024
IfTrueAction=[!SetVariable Scale "1"][!SetVariable ScalePostfix ""][!SetVariable Decimals "0"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureRecycleBinSize >= 1024) && (MeasureRecycleBinSize < 1048576)
IfTrueAction2=[!SetVariable Scale "1024"][!SetVariable ScalePostfix "k"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureRecycleBinSize >= 1048576) && (MeasureRecycleBinSize < 1073741824)
IfTrueAction3=[!SetVariable Scale "1048576"][!SetVariable ScalePostfix "M"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]
IfCondition4=MeasureRecycleBinSize >= 1073741824
IfTrueAction4=[!SetVariable Scale "1073741824"][!SetVariable ScalePostfix "G"][!SetVariable Decimals "2"][!UpdateMeter *][!Redraw]

...
I haven't tested anything else, as I need to get images for the recycle...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ToolTip Scaling

Post by balala »

eclectic-tech wrote: June 18th, 2020, 10:55 pm If you check the Rainmeter log, you will see this error:
"measureBinSize" is unknown: IfCondition=measureBinSize < 1024
...

You named this section [MeasureRecycleBinSize], so change the IfCondition test to test this name in all 4 checks.
That's why it seems (for me at least definitely) a much better approach to use the #CURRENTSECTION# variable instead of naming precisely the measure. For instance instead of IfCondition=MeasureRecycleBinSize < 1024 (or the mistaken IfCondition=MeasureBinSize < 1024), if you use IfCondition=#CURRENTSECTION# < 1024, you can avoid some problems.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: ToolTip Scaling

Post by eclectic-tech »

balala wrote: June 19th, 2020, 9:23 am That's why it seems (for me at least definitely) a much better approach to use the #CURRENTSECTION# variable instead of naming precisely the measure. For instance instead of IfCondition=MeasureRecycleBinSize < 1024 (or the mistaken IfCondition=MeasureBinSize < 1024), if you use IfCondition=#CURRENTSECTION# < 1024, you can avoid some problems.
:17nodding
DuckSlaps
Posts: 5
Joined: June 18th, 2020, 10:05 pm

Re: ToolTip Scaling

Post by DuckSlaps »

Wow, thank you! I didn't even notice that discrepancy. There is still so much more for me to learn about Rainmeter, but I'm loving every minute of it. :D
Last edited by DuckSlaps on June 21st, 2020, 3:50 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 Scaling

Post by balala »

DuckSlaps wrote: June 19th, 2020, 3:07 pm There is still so much more for me to learn about Rainmeter,
For sure and not just for you. After many years of continuous work with it, still are things to be clarified. Probably will never finish this, it is impossible.
The beauty of Rainmeter...