It is currently April 19th, 2024, 11:00 am

Just A Bin not updating after emptying

Get help with creating, editing & fixing problems with skins
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Just A Bin not updating after emptying

Post by J0wNs »

Hello, the Just A Bin basically doesn't update after I right click on it, in fact it still displays the number of files in the bin even if it's empty. What's wrong with it? Here's the code:

Code: Select all

[Rainmeter]
Update=1

[Variables]
IconSize=32
IconEmpty=#@#Empty.png
IconFull=#@#Full.png

[Style]
StringAlign=Right
InlineSetting=Face | Roboto
InlineSetting2=Size | 9
InlineSetting3=Color | 255,255,255,255
AntiAlias=1

[MeasureCount]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
Drives=All

[MeasureSize]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
Drives=All

[MeasureAction]
Measure=Calc
IfCondition=MeasureCount > 0
IfTrueAction=[!RainmeterHideMeter MeterIconEmpty][!RainmeterShowMeter MeterIconFull][!RainmeterShowMeter MeterCount]
IfFalseAction=[!RainmeterHideMeter MeterIconFull][!RainmeterShowMeter MeterIconEmpty][!RainmeterHideMeter MeterCount]

[MeterIconBackground]
Meter=Image
X=15
Y=27
W=19
H=26
SolidColor=255,255,255,1

[MeterIconEmpty]
Meter=Image
X=10
Y=20
W=#IconSize#
ImageName=#IconEmpty#
AntiAlias=1

[MeterIconFull]
Meter=Image
X=10
Y=20
W=#IconSize#
ImageName=#IconFull#
MouseOverAction=[!RainmeterShowMeter MeterSize][!Redraw]
MouseLeaveAction=[!RainmeterHideMeter MeterSize][!Redraw]
LeftMouseUpAction=[!RainmeterPluginBang "MeasureCount OpenBin"]
RightMouseUpAction=[!RainmeterPluginBang "MeasureCount EmptyBin"][!Redraw]
AntiAlias=1

[MeterSize]
Meter=String
MeasureName=MeasureSize
X=55
Y=0
MeterStyle=Style
Text=%1B
AutoScale=1
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Just A Bin not updating after emptying

Post by jsmorley »

Dunno, your code works sorta ok for me, although it never does display the "number of files" in the bin, only the "size", and oh,YIKE! Change Update=1 to Update=1000. You really don't want or need this skin to update every 16 milliseconds. That is just going to use a lot more CPU than you want.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Just A Bin not updating after emptying

Post by jsmorley »

Change your code to

Code: Select all

[Rainmeter]
Update=1000

[Variables]
IconSize=32
IconEmpty=#@#Empty.png
IconFull=#@#Full.png

[Style]
StringAlign=Right
InlineSetting=Face | Roboto
InlineSetting2=Size | 9
InlineSetting3=Color | 255,255,255,255
AntiAlias=1

; [MeasureCount]
; Measure=RecycleManager
; RecycleType=Count

[MeasureSize]
Measure=RecycleManager
RecycleType=Size

[MeasureAction]
Measure=Calc
IfCondition=MeasureSize > 0
IfTrueAction=[!HideMeter MeterIconEmpty][!ShowMeter MeterIconFull][!ShowMeter MeterSize]
IfFalseAction=[!HideMeter MeterIconFull][!ShowMeter MeterIconEmpty][!HideMeter MeterSize]

[MeterIconBackground]
Meter=Image
X=15
Y=27
W=19
H=26
SolidColor=255,255,255,1

[MeterIconEmpty]
Meter=Image
X=10
Y=20
W=#IconSize#
ImageName=#IconEmpty#

[MeterIconFull]
Meter=Image
X=10
Y=20
W=#IconSize#
ImageName=#IconFull#
MouseOverAction=[!ShowMeter MeterSize]
MouseLeaveAction=[!HideMeter MeterSize]
LeftMouseUpAction=[!CommandMeasure MeasureSize OpenBin]
RightMouseUpAction=[!CommandMeasure MeasureSize EmptyBin]

[MeterSize]
Meter=String
MeasureName=MeasureSize
X=55
Y=0
MeterStyle=Style
Text=%1B
AutoScale=1
AntiAlias=1
Observations

Be sure you are running the latest 4.2 release version of Rainmeter from https://www.rainmeter.net/.

The lowest valid value for Update in [Rainmeter] is 16, and that is going to update the skin every 16 milliseconds. You almost NEVER want a value that low, it just uses a ton of CPU. Stay with Update=1000 unless there is some good reason, like some animation you are doing, that requires a lower value.

RecycleManager is no longer a plugin, but a measure.

There is no Drives=All option on RecycleManager.

https://docs.rainmeter.net/manual/measures/recyclemanager/

You don't have any [MeterCount] meter you are showing and hiding in your code, only [MeterSize].

I don't see any current point for having the [MeasureCount] measure. You aren't displaying it.

You are using some long-deprecated syntax like the "Rainmeter" prefix on the bangs and !RainmeterPluginBang, which has been replaced with !CommandMeasure.

https://docs.rainmeter.net/manual/bangs/#Deprecated

You probably don't need AntiAlias=1 on Image meters, but almost certainly do want it on String meters.
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Re: Just A Bin not updating after emptying

Post by J0wNs »

Thanks! I must have changed that by mistake. :???:
Anyways, I think I'm just gonna try to find an updated one or rewrite it.
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Re: Just A Bin not updating after emptying

Post by J0wNs »

I rewrote it, but I have the same issue, it's still displaying Size and Count after I empty it.

Code: Select all

[Rainmeter]
Update=1000

[Fill]
Meter=Image
DynamicVariables=1
UpdateDivider=1
X=15
Y=20
H=75
W=75

[MeasureBinSize]
Measure=RecycleManager
RecycleType=Size
UpdateDivider=5
IfCondition=MeasureBinSize < 1
IfTrueAction=[!SetOption Fill ImageName ""][!Redraw]
IfCondition2=(MeasureBinSize >= 1) && (MeasureBinSize <= 300000000)
IfTrueAction2=[!SetOption Fill ImageName "#@#Bin\fill1.png"][!Redraw]
IfCondition3=MeasureBinSize > 300000000
IfTrueAction3=[!SetOption Fill ImageName "#@#Bin\fill2.png"][!Redraw]
UpdateDivider=1

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count
UpdateDivider=5

[MeterBinSize]
Meter=String
MeasureName=MeasureBinSize
X=35
Y=80
Text=%1B
FontColor=0,0,0
FontSize=8
AntiAlias=1
AutoScale=1

[MeterBinCount]
Meter=String
MeasureName=MeasureBinCount
X=70
Y=40
Text=%1
FontColor=0,0,0
AntiAlias=1

[MeterIcon]
Meter=Image
ImageName=#@#Bin\bin.png
X=15
Y=20
H=75
W=75

[MeterIconInvisibleBackground]
Meter=Image
H=35
W=33
Y=40
X=36
SolidColor=0,0,0,1
LeftMouseUpAction=[!CommandMeasure MeasureBinSize OpenBin][!Refresh][!Update]
RightMouseUpAction=[!CommandMeasure MeasureBinSize EmptyBin][!Refresh][!Update]
DynamicVariables=1
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Just A Bin not updating after emptying

Post by jsmorley »

What are you going for here? Describe the behavior you want.
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Re: Just A Bin not updating after emptying

Post by J0wNs »

The "Fill" meter allows the skin to select from two images that simply indicate the size of the bin. Example: https://i.imgur.com/7BFzgoQ.jpg
As you can see, it says that there are 2 elements that weight 946.5kB, however, the bin is empty and it only shows the correct information if I put something in it and right/left click on it. From what I'm seeing, it never shows 0 elements 0kB, which would indicate that the bin is empty. So I'm thinking to set a new MeasureBinSize = 0 that displays "Empty" as text and Hides the Size and Count meters.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Just A Bin not updating after emptying

Post by jsmorley »

I don't have your images, so I just created 3 quick ones. Full0.png is when the bin is "empty", Full1.png is when the bin contains less than 300000001 bytes, and Full2.png is when the bin contains at least 300000001 bytes.
Full0.png
Full1.png
Full2.png
Then if I use your code, just replacing the image names:

Code: Select all

[Rainmeter]
Update=1000

[Fill]
Meter=Image
X=15
Y=20
H=75
W=75

[MeasureBinSize]
Measure=RecycleManager
RecycleType=Size
IfCondition=MeasureBinSize < 1
IfTrueAction=[!SetOption Fill ImageName "#@#Bin\Full0.png"][!Redraw]
IfCondition2=(MeasureBinSize >= 1) && (MeasureBinSize <= 300000000)
IfTrueAction2=[!SetOption Fill ImageName "#@#Bin\Full1.png"][!Redraw]
IfCondition3=MeasureBinSize > 300000000
IfTrueAction3=[!SetOption Fill ImageName "#@#Bin\Full2.png"][!Redraw]
UpdateDivider=1

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count

[MeterBinSize]
Meter=String
MeasureName=MeasureBinSize
X=35
Y=80
Text=%1B
FontColor=0,0,0
FontSize=8
AntiAlias=1
AutoScale=1

[MeterBinCount]
Meter=String
MeasureName=MeasureBinCount
X=70
Y=38
Text=%1
FontColor=0,0,0
AntiAlias=1

[MeterIcon]
Meter=Image
ImageName=#@#Bin\bin.png
X=15
Y=20
H=75
W=75

[MeterIconInvisibleBackground]
Meter=Image
H=35
W=33
Y=40
X=36
SolidColor=0,0,0,1
LeftMouseUpAction=[!CommandMeasure MeasureBinSize OpenBin][!Refresh][!Update]
RightMouseUpAction=[!CommandMeasure MeasureBinSize EmptyBin][!Refresh][!Update]
DynamicVariables=1
I get:
3.jpg
1.jpg
2.jpg
So I guess I just don't understand the issue you are having.
You do not have the required permissions to view the files attached to this post.
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Re: Just A Bin not updating after emptying

Post by J0wNs »

J0wNs wrote:The "Fill" meter allows the skin to select from two images that simply indicate the size of the bin. Example: https://i.imgur.com/7BFzgoQ.jpg
As you can see, it says that there are 2 elements that weight 946.5kB, however, the bin is empty and it only shows the correct information if I put something in it and right/left click on it. From what I'm seeing, it never shows 0 elements 0kB, which would indicate that the bin is empty. So I'm thinking to set a new MeasureBinSize = 0 that displays "Empty" as text and Hides the Size and Count meters.
This is what I made:

Code: Select all

[MeasureBinEmpty]
Measure=RecycleManager
RecycleType=Size
UpdateDivider=5
IfCondition=MeasureBinSize < 1
IfTrueAction=[!HideMeterGroup "Info"][!ShowMeter "MeterEmpty"][!Redraw]
IfFalseAction=[!HideMeter "MeterEmpty"][!ShowMeterGroup "Info"][!Redraw]

[MeterEmpty]
Meter=String
Text=Empty
FontSize=8
AntiAlias=1
X=35
Y=75
Still doesn't properly detect wheter the bin is empty or not.
Anyways, I got that working, the issue is still the same.
J0wNs
Posts: 32
Joined: June 16th, 2018, 9:27 pm

Re: Just A Bin not updating after emptying

Post by J0wNs »

jsmorley wrote:I don't have your images, so I just created 3 quick ones. Full0.png is when the bin is "empty", Full1.png is when the bin contains less than 300000001 bytes, and Full2.png is when the bin contains at least 300000001 bytes.

Full0.png
Full1.png
Full2.png

Then if I use your code, just replacing the image names:

Code: Select all

[Rainmeter]
Update=1000

[Fill]
Meter=Image
X=15
Y=20
H=75
W=75

[MeasureBinSize]
Measure=RecycleManager
RecycleType=Size
IfCondition=MeasureBinSize < 1
IfTrueAction=[!SetOption Fill ImageName "#@#Bin\Full0.png"][!Redraw]
IfCondition2=(MeasureBinSize >= 1) && (MeasureBinSize <= 300000000)
IfTrueAction2=[!SetOption Fill ImageName "#@#Bin\Full1.png"][!Redraw]
IfCondition3=MeasureBinSize > 300000000
IfTrueAction3=[!SetOption Fill ImageName "#@#Bin\Full2.png"][!Redraw]
UpdateDivider=1

[MeasureBinCount]
Measure=RecycleManager
RecycleType=Count

[MeterBinSize]
Meter=String
MeasureName=MeasureBinSize
X=35
Y=80
Text=%1B
FontColor=0,0,0
FontSize=8
AntiAlias=1
AutoScale=1

[MeterBinCount]
Meter=String
MeasureName=MeasureBinCount
X=70
Y=38
Text=%1
FontColor=0,0,0
AntiAlias=1

[MeterIcon]
Meter=Image
ImageName=#@#Bin\bin.png
X=15
Y=20
H=75
W=75

[MeterIconInvisibleBackground]
Meter=Image
H=35
W=33
Y=40
X=36
SolidColor=0,0,0,1
LeftMouseUpAction=[!CommandMeasure MeasureBinSize OpenBin][!Refresh][!Update]
RightMouseUpAction=[!CommandMeasure MeasureBinSize EmptyBin][!Refresh][!Update]
DynamicVariables=1
I get:

3.jpg
1.jpg
2.jpg

So I guess I just don't understand the issue you are having.

Here's a gif showing the issue: https://gfycat.com/ViciousGargantuanAntarcticfurseal
As you can see, the bin is empty but it still shows the infos of the previous element that was in it.