It is currently March 29th, 2024, 1:08 pm

Help: Changing Recycle Bin Icon

Get help with creating, editing & fixing problems with skins
User avatar
ritoshishino
Posts: 3
Joined: May 13th, 2020, 9:37 am

Help: Changing Recycle Bin Icon

Post by ritoshishino »

I'm still new to Rainmeter, let alone making my own skin so forgive me if this is an easy problem
I'm making my image launcher for the recycle bin and was wondering how to have its icon change when the bin is full like it would in normal Windows. I tried looking around a little bit to see if anyone has asked this before and was resolved but couldn't find any.
What code do I use? Was this something taught in the Rainmeter tutorial that I just happened to miss?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Changing Recycle Bin Icon

Post by balala »

ritoshishino wrote: May 15th, 2020, 4:24 am I'm still new to Rainmeter, let alone making my own skin so forgive me if this is an easy problem
No, there is nothing which is an "easy problem". What is easy for one, might be hard for another, so don't worry.
ritoshishino wrote: May 15th, 2020, 4:24 am I'm making my image launcher for the recycle bin and was wondering how to have its icon change when the bin is full like it would in normal Windows. I tried looking around a little bit to see if anyone has asked this before and was resolved but couldn't find any.
What code do I use?
You have to add an IfCondition to the RecycleManager measure, which sets the image of the meter representing the icon accordingly to the numberof the files residing into the recycle bin:

Code: Select all

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterBin ImageName "#@#BIN-EMPTY-IMAGE.png"][!UpdateMeter "MeterBin"][!Redraw]
IfFalseAction=[!SetOption MeterBin ImageName "#@#BIN-FULL-IMAGE.png"][!UpdateMeter "MeterBin"][!Redraw]
where [MeterBin] is a simple Image meter, showing the appropriate icon:

Code: Select all

[MeterBin]
Meter=Image
Basically this meter has to have nothing set except its type, because the image is set through the !SetOption bangs of the IFTrueAction and IfFalseAction options of the [MeasureBinCount] measure.
User avatar
ritoshishino
Posts: 3
Joined: May 13th, 2020, 9:37 am

Re: Help: Changing Recycle Bin Icon

Post by ritoshishino »

You have to add an IfCondition to the RecycleManager measure, which sets the image of the meter representing the icon accordingly to the numberof the files residing into the recycle bin:

Code: Select all

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterBin ImageName "#@#BIN-EMPTY-IMAGE.png"][!UpdateMeter "MeterBin"][!Redraw]
IfFalseAction=[!SetOption MeterBin ImageName "#@#BIN-FULL-IMAGE.png"][!UpdateMeter "MeterBin"][!Redraw]
where [MeterBin] is a simple Image meter, showing the appropriate icon:

Code: Select all

[MeterBin]
Meter=Image
Basically this meter has to have nothing set except its type, because the image is set through the !SetOption bangs of the IFTrueAction and IfFalseAction options of the [MeasureBinCount] measure.
Thanks a lot for your help
So I tried adding in the IfCondition like you suggested, however, after doing so, the launcher doesn't appear on screen anymore
here is my code right now, is there anything missing?

Code: Select all

[Rainmeter]
Update=1000

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count
IfcCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterBin ImageName "#@#Images\BunnyTrash.png"][!UpdateMeter "MeterBin"][!Redraw]
IfFalseAction=[!SetOption MeterBin ImageName "#@#Images\BunnyTrashFull.png"][!UpdateMeter "MeterBin"][!Redraw]

[MeterBin]
Meter=Image
W=200
H=200
LeftMouseUpAction=[Shell:::{645FF040-5081-101B-9F08-00AA002F954E}]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Changing Recycle Bin Icon

Post by balala »

ritoshishino wrote: May 15th, 2020, 7:47 am So I tried adding in the IfCondition like you suggested, however, after doing so, the launcher doesn't appear on screen anymore
here is my code right now, is there anything missing?
Yep, there is not missing anything, but the IfCondition is miswritten as IfcCondition. Fix this.
User avatar
ritoshishino
Posts: 3
Joined: May 13th, 2020, 9:37 am

Re: Help: Changing Recycle Bin Icon

Post by ritoshishino »

balala wrote: May 15th, 2020, 8:34 am Yep, there is not missing anything, but the IfCondition is miswritten as IfcCondition. Fix this.
Yikes, I even checked for typo but somehow missed that.
Thanks for pointing that out, it's working perfectly now.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Changing Recycle Bin Icon

Post by balala »

ritoshishino wrote: May 15th, 2020, 8:53 am it's working perfectly now.
Ok, I'm glad.