It is currently April 25th, 2024, 4:38 pm

Recycle Bin

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

It's up to you how you want it to look and work. Take a look at this code to see how I use an invisible background meter for the ToolTip so it appears when I am on either the image or the text, and how I use !SetOption to control which image is displayed (empty or full) and whether or not the ToolTip is shown. (for me it makes no sense at all to even have one when the bin is empty)

Code: Select all

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

[Variables]
ItemPostFix="s"
ScaleFactor="B"

[MeasureBinCount]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=MeasureBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "Empty"][!SetOption MeterBinImage ImageName "RecycleEmpty.png"][!SetOption MeterBackground ToolTipHidden "1"]
IfCondition2=MeasureBinCount = 1
IfTrueAction2=[!SetVariable ItemPostfix ""][!SetOption MeterBinText Text "[MeasureBinCount] item"][!SetOption MeterBinImage ImageName "RecycleFull.png"][!SetOption MeterBackground ToolTipHidden "0"]
IfCondition3=MeasureBinCount > 1
IfTrueAction3=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "[MeasureBinCount] items"][!SetOption MeterBinImage ImageName "RecycleFull.png"][!SetOption MeterBackground ToolTipHidden "0"]
IfConditionMode=1
UpdateDivider=2

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
IfCondition=MeasureBinSize < 1024
IfTrueAction=[!SetOption MeasureScaledSize Formula "[MeasureBinSize]"][!SetVariable ScaleFactor "B"]
IfCondition2=(MeasureBinSize >= 1024) && (MeasureBinSize < 1024**2)
IfTrueAction2=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/1024,1)"][!SetVariable ScaleFactor "kB"]
IfCondition3=(MeasureBinSize >= 1024**2) && (MeasureBinSize < 1024**3)
IfTrueAction3=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**2),1)"][!SetVariable ScaleFactor "MB"]
IfCondition4=(MeasureBinSize >= 1024**3) && (MeasureBinSize < 1024**4)
IfTrueAction4=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**3),1)"][!SetVariable ScaleFactor "GB"]
IfCondition5=MeasureBinSize >= 1024**4
IfTrueAction5=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**4),1)"][!SetVariable ScaleFactor "TB"]
IfConditionMode=1
UpdateDivider=2

[MeasureScaledSize]
Measure=Calc
Formula=0
UpdateDivider=2

[MeterBackground]
Meter=Image
W=120
H=45
SolidColor=0,0,0,1
ToolTipIcon=Info
ToolTipTitle=Recycle Bin
ToolTipText=[MeasureBinCount] item#ItemPostfix##CRLF#[MeasureScaledSize] #ScaleFactor##CRLF##CRLF#L-click = Open#CRLF#R-click = Empty
Text=Empty
DynamicVariables=1

[MeterBinImage]
Meter=Image
ImagePath=#@#Images\
ImageName=RecycleEmpty.png
W=45
H=45
SolidColor=0,0,0,1
LeftMouseUpAction=[!CommandMeasure MeasureBinCount "OpenBin"]
RightMouseUpAction=[!CommandMeasure MeasureBinCount "EmptyBinSilent"]

[MeterBinText]
Meter=String
X=5R
Y=10
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
2014-04-25_191211.jpg
Everything I have posted in this thread so far is intended to give you some sense of how Rainmeter works and the kind of things you can do with !IfCondition and !SetOption / !SetVariable to react to changing measure values. Now it is up to you to make use of that to get what YOU want.

P.S. Entirely up to you of course, but I really don't like a tooltip at all on a recycle bin skin. I just show the relevant data in String meters, display the appropriate image, and be done with it. Anyone who needs to be told what clicks do what with the recycle bin in Windows really doesn't need to be using Rainmeter in the first place. In my view, the tooltip is just annoying when it pops up as you are trying to empty the bin.
2014-04-25_191211.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

I was in the process of figuring out how to merge the two codes rather than just copy and paste as I wanted to solve it myself. I managed to get the Image I have working with your code.

Then I had thoughts about changing the BinImage when it had items in it, and you read my mind! Thing is I've changed your second code to include the name of my image but it won't show even though I've emptied the Bin. I don't have the full image to hand at the moment as I only used the Empty one.

I'm gonna have to leave it now though, it's 12.30am and my 2year old keeps getting out of bed! I'll take another look tomorrow, thanks mr morley, sorry it is mr and not miss/mrs? :oops: :thumbup:

btw, thanks for making such a great app, not only useful, but fun to play with! :)
- MuLab -
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

If your image isn't showing, then it is absolutely an issue with the path in ImagePath or ImageName to the image file.

For debugging, look at the About / Log panel from the Rainmeter tray icon to see errors, and the About / Skin panel to show the current values for measures and variables. About is an indispensable tool when working on skins.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

I noticed that I used a single line for the image:
ImageName=#@#Launchers\BinEmptyOrg.png

Whereas you specified two lines:
ImagePath=#@#Launchers\BinEmptyOrg.png
ImageName=BinEmptyOrg.png

Not sure if this matters?

The first code you gave me worked, the second doesn't show an image. I've changed the code to show my image but it doesn't show it despite the Bin being empty?! Here's your code updated to my preference:

Code: Select all

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

[Variables]
ItemPostFix="s"
ScaleFactor="B"

[mBinCount]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=mBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption BinText Text "Empty"][!SetOption BinImage ImageName "BinEmptyOrg.png"][!SetOption Background ToolTipHidden "1"]
IfCondition2=mBinCount = 1
IfTrueAction2=[!SetVariable ItemPostfix ""][!SetOption BinText Text "[mBinCount] item"][!SetOption BinImage ImageName "BinFullOrg.png"][!SetOption Background ToolTipHidden "0"]
IfCondition3=mBinCount > 1
IfTrueAction3=[!SetVariable ItemPostfix "s"][!SetOption BinText Text "[mBinCount] items"][!SetOption BinImage ImageName "BinFullOrg.png"][!SetOption Background ToolTipHidden "0"]
IfConditionMode=1
UpdateDivider=2

[mBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
IfCondition=mBinSize < 1024
IfTrueAction=[!SetOption mScaledSize Formula "[mBinSize]"][!SetVariable ScaleFactor "B"]
IfCondition2=(mBinSize >= 1024) && (mBinSize < 1024**2)
IfTrueAction2=[!SetOption mScaledSize Formula "Round([mBinSize]/1024,1)"][!SetVariable ScaleFactor "kB"]
IfCondition3=(mBinSize >= 1024**2) && (mBinSize < 1024**3)
IfTrueAction3=[!SetOption mScaledSize Formula "Round([mBinSize]/(1024**2),1)"][!SetVariable ScaleFactor "MB"]
IfCondition4=(mBinSize >= 1024**3) && (mBinSize < 1024**4)
IfTrueAction4=[!SetOption mScaledSize Formula "Round([mBinSize]/(1024**3),1)"][!SetVariable ScaleFactor "GB"]
IfCondition5=mBinSize >= 1024**4
IfTrueAction5=[!SetOption mScaledSize Formula "Round([mBinSize]/(1024**4),1)"][!SetVariable ScaleFactor "TB"]
IfConditionMode=1
UpdateDivider=2

[mScaledSize]
Measure=Calc
Formula=0
UpdateDivider=2

[Background]
Meter=Image
W=120
H=45
SolidColor=0,0,0,1
ToolTipIcon=Info
ToolTipTitle=Recycle Bin
ToolTipText=[mBinCount] item#ItemPostfix##CRLF#[mScaledSize] #ScaleFactor##CRLF##CRLF#L-click = Open#CRLF#R-click = Empty
Text=Empty
DynamicVariables=1

[BinImage]
Meter=Image
ImagePath=#@#Launchers\BinEmptyOrg.png
ImageName=BinEmptyOrg.png
W=45
H=45
SolidColor=0,0,0,1
LeftMouseUpAction=[!CommandMeasure mBinCount "OpenBin"]
RightMouseUpAction=[!CommandMeasure mBinCount "EmptyBin"]

[BinText]
Meter=String
X=5R
Y=10
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Currently I have an Image and Text for the Bin. I wanted a simpler GUI and thought about removing the Text and making it a ToolTip. The info isn't something you need all the time so it would be better suited in a ToolTip that appears only when needed. It doesn't appear over the cursor so it's not in the way. I prefer a minimal interface so am trying to get all info to show only when needed or have only important info shown. But, that's just my preference.
- MuLab -
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

sl23 wrote:I noticed that I used a single line for the image:
ImageName=#@#Launchers\BinEmptyOrg.png

Whereas you specified two lines:
ImagePath=#@#Launchers\BinEmptyOrg.png
ImageName=BinEmptyOrg.png

Not sure if this matters?

The first code you gave me worked, the second doesn't show an image. I've changed the code to show my image but it doesn't show it despite the Bin being empty?!
I used ImagePath so that when I change the image in a bang, I only have to specify the different ImageName of the image files, and not the entire path. Just shortens the work I do in the bangs. You can either use ImagePath and just a name in ImageName, or put the entire path and name right in ImageName. Up to you.

However, you are trying to do both. You are just using ImageName in the meter with the full path and name when the skin is first loaded, (which is fine) but then in the bang just specifying the name with no path when you change the meter option with !SetOption. Since there is no path specified, it assumes the image file is in the current (skin) folder and fails. You either need to use ImagePath on the meter like I did, then just change the name in the bangs, or specify the full path and name in the bangs.
Currently I have an Image and Text for the Bin. I wanted a simpler GUI and thought about removing the Text and making it a ToolTip. The info isn't something you need all the time so it would be better suited in a ToolTip that appears only when needed. It doesn't appear over the cursor so it's not in the way. I prefer a minimal interface so am trying to get all info to show only when needed or have only important info shown. But, that's just my preference.
That's fine. At the end of the day, your preference is the only thing that matters.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

Yes I do get the error, but I don't get why? #@# is the resources folder for the current skin isn't?
Ok, here's my folder structure using RM as Portable:

RM is here -
D:\MyApps\PortableApps\Rainmeter\

Skins are all currently here, though I plan on renaming the folder at some point, this shouldn't affect the skins though should it? -
D:\MyApps\PortableApps\Rainmeter\Skins\Soita+System\

Resources folder:
D:\MyApps\PortableApps\Rainmeter\Skins\Soita+System\@Resources\

Icons for Launchers:
D:\MyApps\PortableApps\Rainmeter\Skins\Soita+System\@Resources\Launchers

Bin Icons:
@Resources\Launchers\BinEmptyOrg.png
@Resources\Launchers\BinFullOrg.png

Whilst writing this I thought that it could be that I didn't specify the Launchers folder, but that didn't work either. I see no difference between these paths and the other icons that work ok?

I changed this Measure to reflect the Paths, is it necessary or causing a problem?

Code: Select all

[mBinCount]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=mBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption BinText Text "Empty"][!SetOption BinImage ImageName "#@#Launchers\BinEmptyOrg.png"][!SetOption Background ToolTipHidden "1"]
IfCondition2=mBinCount = 1
IfTrueAction2=[!SetVariable ItemPostfix ""][!SetOption BinText Text "[mBinCount] item"][!SetOption BinImage ImageName "#@#Launchers\BinFullOrg.png"][!SetOption Background ToolTipHidden "0"]
IfCondition3=mBinCount > 1
IfTrueAction3=[!SetVariable ItemPostfix "s"][!SetOption BinText Text "[mBinCount] items"][!SetOption BinImage ImageName "#@#Launchers\BinFullOrg.png"][!SetOption Background ToolTipHidden "0"]
IfConditionMode=1
UpdateDivider=2
Originally I just changed the file name to suit my icon, but added path since you mention it is that causing a problem. I am well confused now!!!
- MuLab -
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

Read my last post again carefully. I may have edited it after you posted.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

I don't know whether to laugh or cry ! :-( :rolmfao: :?

Currently I have my own SideBar skin running with my original bodged code, but also I have created a new skin with only your code in. Your first code does exactly what I want and works all as it should. But as you added that rather fine idea of having the full bin image, I'm trying to get that working as a seperate skin from my own before adding it to the SideBar skin.

Ah ok didn't realise about folder names too. But as I said I'd planned on renaming it as that has been like that since starting to make skins over a year ago!

I'm still confused, sorry I just don't get it? You're telling me to specify an Images Path but you haven't done that for BinFull.png? Which I changed to BinFullOrg.png btw.

Also, as I just posted, I had added the #@#Launchers\BinFullOrg.png or #@#Launchers\BinEmptyOrg.png to the corresponding meaures, and it didn't work.

What I don't get is why do I get an error and no Image for an Empty Bin when the path is specified and is correct? And nowhere have you specified the location of BinFull.png but yours works?

Is there a smilie for pulling your hair out?!
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

:handtohead: :handtohead: :handtohead:

Ok, I see it!!! The path had specifies where both images are and the IfCondition changes which is shown. What threw me is that your code had the BinEmpty.png as part of the path. I then changed this to BinEmptyOrg.png. Now what I don't get is that if yours worked why didn't mine? Oh I got it to work by deleting the BinEmptyOrg.png from the ImagePath=

Odd!

Sorry, I wasn't deliberately trying to be difficult ! :lol:

Nope, sorry, my stupid mistake! I put it there for some reason, probably cos I was copy/pasting! Sorry bout that :oops:

EDIT:
All sorted, thanks again for your help :yahoo:
- MuLab -