It is currently March 29th, 2024, 1:16 am

"Make It Rain"meter

Skins that don't neatly fit into other categories
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: "Make It Rain"meter

Post by eclectic-tech »

Alright, I see what you are trying, but may not follow all of it.

Let me first explain why you are having issues placing the button where you want.

The icon image I used is actually 10 times larger than the image you see in the skin. This is accomplished by the TransformationMatrix code in the meter. It modifies the displayed image to my scale variable which is 0.1, so the icon appears one-tenth of it's actual size. The TransformationMatrix code modifies the displayed image, but it DOES NOT CHANGE THE ORIGINAL SIZE OF THE IMAGE. So although you see a small icon, the skin is 10 times larger vertically and horizontally. The reddish area in the image below shows the actual size of the skin if the icon was scaled to 1x; that is why you can not move it all the way to the right edge or to the screen bottom.
showhidetoggle2.png
The simplest solution is to edit the image in a graphic editor and make it the size you want in your skin (I did it below), but did not edit the code to use that image.

You removed the [Rainmeter] section from the code, which had the action bang. Without that, there is no toggle of all skins, no modifying of the OnUpdateAction in the meter, and no refresh the skin to reset the skin for the next action (basically the heart and soul of my skin)... but this will still show all skins all the time every second. So when you toggle your skins with the button, 1 second later the OnUpdateAction will show all skins again!

What you posted will only toggle your active group when you left click the string meter, and then use the [#Action[#Action]] variable in the OnUpdateAction to show all skins, because there is no [Rainmeter] section, and the skin updates at the default 1000 ms.

I would suggest NOT putting it back into the code unless you want to hide all skin (including this one), then toggle your group; I haven't tried doing that since I do not know what you want to happen in your code.

I would suggest editing the icon to the size you want, use that in the image meter, remove the TransformationMatrix line from the image meter, remove the OnUpdateAction line, and add some left padding to the string meter so the text does not cover the icon. That will let you move the button almost anywhere and toggle your skin group.

Code: Select all

; ========= Variables ==========

[Variables]
Scale=0.1
; Scale Suggested Sizes
; Scale 0.0625 will match notification area icon size
; Scale 0.0625 will also match Windows 10 small taskbar icon size
; Scale 0.1 will match Windows 10 taskbar size

;
;VVVVVVVVVVVVVVV <<<< This button (Image) I want to use instead of the framed Text= Button above. 

; DO NOT EDIT THESE

Action=0
Action1=[!Hide *][!show "MyToggleSkinGroup"][!Redraw]
Action0=[!Show *][!Redraw]

; ========= Meters ========== 

[ToggleTelemetry]
Meter=String
SolidColor=100,100,100,100
Padding=24,8,8,8
FontColor=255,255,255
Text="Toggle Skins"
LeftMouseUpAction=[!ToggleGroup "MyToggleSkinGroup"]

[Image]
Meter=Image
ImageName=#@#Images\Rainmeter_256
SolidColor=0,0,0,1
OnUpdateAction=[#Action[#Action]]
TransformationMatrix=#Scale#;0;0;#Scale#;0;0
DynamicVariables=1

Here is the icon reduced to 18x26 size for you to use instead of the large one.
Rainmeter_18x26.png
You do not have the required permissions to view the files attached to this post.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: "Make It Rain"meter

Post by dfghrngsdkg »

Oi!

Sorry for confusing you, it's probably because English is not my native tongue and I am lacking the right terminology when it comes to coding. So please bare with me while I will start all over again.

I want to create a Skin, a .ini that loads/unloads certain (defined) skins. Your original code is fine as it not only matches all of my criteria but also comes with a resize-able Raindrop-Button which I want to use. The only issue with your code is: It shows/hides all Rainmeter Skins and therefore can't be used in its current state as you told me - unless its necessary parts are modified.

Seems doable and so I expected that it is not much of a hassle, because to me it seems that all we have to do is to only replace/modify a single? line of code:

From:

"; Hide/Show All Skins
"LeftMouseUpAction=[!WriteKeyValue Variables Action (1-#Action#)][!SetOption Meter OnUpdateAction [#Action[#Action]]][!UpdateMeter Meter][!Redraw][!Refresh #CurrentConfig#]"

to "something" like this:

"; Load/Unload certain Skins
"LeftMouseUpAction=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"][Bla Bla Bla .....][!SetOption Meter OnUpdateAction [#Action[#Action]]][!Redraw]?[!Refresh #CurrentConfig#]"

(As in theory two commands can be combined into a single Line if it has a [!Redraw] at its end to define two states: 1/0 = on/off), right?

So here you can see my problem. I do not know what parts from your code I have to keep (to make the code work + to keep the Raindrop-Button working the way it is) and what part of the code I have to delete/to alter since I am not familiar with all its meanings/functions and its inter-play.

For example: I probably would delete: [!Refresh #CurrentConfig#]", but I can see from the code that this is also part of the "Action=" command which is linked to the Raindrop-Button (same as?: [!WriteKeyValue Variables Action (1-#Action#)][!SetOption Meter OnUpdateAction [#Action[#Action]]]). Here I stuck in what to do and the file gets messed up.

For the Button: I do not exactly understand why it behaves like this in the altered file. Next to your explanation I further guess that it has something to to with the "Text=" interference. Anyhow, for now I managed to have the Button resize-able and be able to be placed anywhere the Desktop's border (see code).


To summarize our achievements so far:
1. We have successfully created the "Toggle" part with "Group=" values placed in the files we use as examples.
2. We have successfully created two !Bangs:
- LeftMouseUpAction=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"]
- LeftMouseUpAction=[!DectivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"]

The only remaining question is: How can I have a .ini that loads/unloads defined skins with a single line of code (like yours) that works with a single Raindrop-Button (like yours) or alternatively, if it doesn't work this way: How to combine [ShowSkins] + [HideSkins] to make it work with a single, resize-able Raindrop-Button. In short: Your file, now able to load/unload various skins.

The code as far as I could get:

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
;Group=#RootConfig#
DynamicWindowSize=1
SkinWidth=(175*#Scale#)
SkinHeight=(256*#Scale#)
OnRefreshAction=[!ZPos -2]

[ShowHideSkins]
Meter=String
ImageName=#@#Images\Rainmeter_256
LeftMouseUpAction=[!DeactivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"][!SetOption Meter OnUpdateAction [#Action[#Action]]][!UpdateMeter Meter][!Redraw]



; ========= Variables ==========

[Variables]
Scale=0.2
; Scale Suggested Sizes
; Scale 0.0625 will match notification area icon size
; Scale 0.0625 will also match Windows 10 small taskbar icon size
; Scale 0.1 will match Windows 10 taskbar size


; DO NOT EDIT THESE

Action=0
Action1=[!Hide *][ "#CurrentConfig#"][!Redraw]
Action0=[!Show *][!Redraw]


; ========= Meters ========== 


[Image]
Meter=Image
ImageName=#@#Images\Rainmeter_256
SolidColor=0,0,0,1
OnUpdateAction=[#Action[#Action]]
TransformationMatrix=#Scale#;0;0;#Scale#;0;0
DynamicVariables=1

Note: I have Photoshop and a button of my own choise too. For now I use yours to make sure that both of us having the same tools but in case you like to give it a try:
Graph_II.png


I further apologize for occupying your valuable leisure time and remain with kind regards,
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: "Make It Rain"meter

Post by eclectic-tech »

dfghrngsdkg wrote:The only remaining question is: How can I have a .ini that loads/unloads defined skins with a single line of code (like yours) that works with a single Raindrop-Button (like yours) or alternatively, if it doesn't work this way: How to combine [ShowSkins] + [HideSkins] to make it work with a single, resize-able Raindrop-Button. In short: Your file, now able to load/unload various skins.
The only way to load multiple skins in single line of code is with multiple !ActivateConfig bangs that specifying each skin (like what I showed for the 2 illustro skins), or create a layout of the skins you want to load/unload, save it, and use !LoadLayout.

That is about all I can suggest. From here you need to decide which skins you want to work with, add them to a group, and create a layout.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: "Make It Rain"meter

Post by dfghrngsdkg »

Hey,

It's OK, right now I will go with multiple !ActivateConfig bangs because of a) learning curve and b) as I have not much to deactivate. If it becomes more I'll go by !LoadLayout. For educational purposes I stick to Illustro Clock and Disk1.


Is-situation:

The Code is (almost) there but somehow incomplete and even if I use your !ActivateConfig this and that it still won't work with me not knowing what else to add because I am inexperienced. Same goes for the Raindrop-Button that is now there and scale-able, but still I can't make it interact neither because of the interlinks missing in the code (loose ends) which I do not see .

I've tried something like this too:

Code: Select all

[ShowHideSkins]
Meter=String
ImageName=#@#Images\Rainmeter_256
LeftMouseUpAction=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"]OnUpdateAction=[#Action[#Action]][!Redraw]
LeftMouseUpAction2=[!DectivateConfig "illustro\clock" "clock.ini"][!DeactivateConfig "illustro\disk" "1 disk.ini"]
It gives me nothing and I'm about to give in.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: "Make It Rain"meter

Post by eclectic-tech »

If you just want to toggle a group of skins, you do not need to do what I did.
I changed the meter action so it updates the variable, updates the skin, then performs the new action. There is no need to refresh the skin or set any options, since DynamicVariables=1 will use the latest value of the "Action" variable.
This will toggle your group hidden on first click, shown on second, hidden on third, shown on fourth, etc.

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
Group=#RootConfig#
DynamicWindowSize=1
;SkinWidth=(175*#Scale#)
SkinHeight=(256*#Scale#)
OnRefreshAction=[!ZPos +2]

; ========= Variables ==========
[Variables]
Scale=0.0625
; Scale Suggested Sizes
; Scale 0.0625 will match notification area icon size
; Scale 0.0625 will also match Windows 10 small taskbar icon size
; Scale 0.1 will match Windows 10 taskbar size

; DO NOT EDIT THESE
Action=0
Action1=[!HideGroup "MyToggleSkinGroup"][!Redraw]
Action0=[!ShowGroup "MyToggleSkinGroup"][!Redraw]

; ========= Meters ==========

[Meter]
Meter=Image
ImageName=#@#Images\Rainmeter_256
; ImageName=#@#Images\Rainstaller_256
; Alternate "Green" Icon
SolidColor=0,0,0,1
LeftMouseUpAction=[!SetVariable Action (1-#Action#)][!Update][#Action[#Action]]
TransformationMatrix=#Scale#;0;0;#Scale#;0;0
DynamicVariables=1
Regarding the code you posted:
You can combine multiple BANGS on a single line but NOT multiple KEYWORD=OPTION; so the "OnUpdateAction=..." needs to be on a separate line.
There is no such bang "LeftMouseUpAction2" ... you can not have duplicate mouse action bangs in the same section.

Use the "Log" in !ABOUT while working on skins to see error messages. This will let you know what is or isn't working.

:welcome:
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: "Make It Rain"meter

Post by dfghrngsdkg »

Thank you for clarifying some things for me and thus giving me hope of some sort. :thumbup: :rosegift:

Two things you might want to take a look at:

1. The "Toggle" works now as intended. One thing I figured is: If I toggle the Skins (hide them) and I restart the computer, the Skins are back (guess it is the way it is set and therefore plausible if they show up on restart). The question is: If I set:

Code: Select all

Action1=[!HideGroup "MyToggleSkinGroup"][!Redraw]
to:

Code: Select all

Action1=[!ShowGroup "MyToggleSkinGroup"][!Redraw]
is it then in reverse aka the Skins are hidden on restart and I can toggle then "on"?

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

2.(and more importantly): I used parts of your now working Toggle-Code (the one with the working Raindrop-Button) on the "load/unload Skins".ini (please see code below). When pressing the button the Skins "show up" and "hide", but here I am not sure that they "load/unload" or are only "toggled". Can you please look into this one to check that the code is correct (and if needed to refine it for me)? What I assume is, that the Skins are still in a "toggle" (show/hide) mode due to the "Action1/0" setting - instead of being |activated/deactivated" since both "Actions" still contain "MyToggleSkinGroup". But I can't say it with certainty since I can't figure it out.

Thank you in advance,

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
Group=#RootConfig#
DynamicWindowSize=1
SkinWidth=(175*#Scale#)
SkinHeight=(256*#Scale#)
OnRefreshAction=[!ZPos -2]


[ShowSkins]
Meter=Image
MeterImageName=#@#Images\Rainstaller_256
LeftMouseUpAction=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"]



[HideSkins]
Meter=Image
MeterImageName=#@#Images\Rainstaller_256
LeftMouseUpAction=[!DeactivateConfig "illustro\clock" "clock.ini"][!DeactivateConfig "illustro\disk" "1 disk.ini"]




; ========= Variables ==========
[Variables]
Scale=0.1
; Scale Suggested Sizes
; Scale 0.0625 will match notification area icon size
; Scale 0.0625 will also match Windows 10 small taskbar icon size
; Scale 0.1 will match Windows 10 taskbar size

; DO NOT EDIT THESE
Action=0
Action1=[!HideGroup "MyToggleSkinGroup"][!Redraw]
Action0=[!ShowGroup "MyToggleSkinGroup"][!Redraw]

; ========= Meters ==========

[Meter]
Meter=Image
ImageName=#@#Images\Rainstaller_256
; ImageName=#@#Images\Rainstaller_256
; Alternate "Green" Icon
SolidColor=0,0,0,1
LeftMouseUpAction=[!SetVariable Action (1-#Action#)][!Update][#Action[#Action]]
TransformationMatrix=#Scale#;0;0;#Scale#;0;0
DynamicVariables=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: "Make It Rain"meter

Post by eclectic-tech »

dfghrngsdkg wrote: September 20th, 2019, 10:17 am Two things you might want to take a look at:

1. The "Toggle" works now as intended. One thing I figured is: If I toggle the Skins (hide them) and I restart the computer, the Skins are back (guess it is the way it is set and therefore plausible if they show up on restart). The question is: If I set:

Code: Select all

Action1=[!HideGroup "MyToggleSkinGroup"][!Redraw]
to:

Code: Select all

Action1=[!ShowGroup "MyToggleSkinGroup"][!Redraw]
is it then in reverse aka the Skins are hidden on restart and I can toggle then "on"?
No. Unless the meters in the skin are hidden, they will show when the skin is loaded.
https://docs.rainmeter.net/manual/meters/general-options/#Hidden
Or skins can be set starthidden: https://docs.rainmeter.net/manual/settings/skin-sections/#StartHidden
dfghrngsdkg wrote:2.(and more importantly): I used parts of your now working Toggle-Code (the one with the working Raindrop-Button) on the "load/unload Skins".ini (please see code below). When pressing the button the Skins "show up" and "hide", but here I am not sure that they "load/unload" or are only "toggled". Can you please look into this one to check that the code is correct (and if needed to refine it for me)? What I assume is, that the Skins are still in a "toggle" (show/hide) mode due to the "Action1/0" setting - instead of being |activated/deactivated" since both "Actions" still contain "MyToggleSkinGroup". But I can't say it with certainty since I can't figure it out.
As I said before, you need to look at the manage dialog and log. They will tell you what skins are active and what actions and errors.

I am going to stop here. I have given you 2 working versions and suggestions that should make it possible to add features, but can not keep play "fetch that stick".

If you have more questions, please post your code and questions as a new topic in Help with Rainmeter Skins
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: "Make It Rain"meter

Post by dfghrngsdkg »

Hey,

It's OK now. It took me a while, but I think I figured it out now. The !Log thingy gave me nothing I could work with, however I found this one: https://forum.rainmeter.net/viewtopic.php?f=127&t=28720&hilit=configactive#p149824 which helped me to check the status while working on the .ini. Does it need?: Group=#RootConfig# ? No clue - it seems to work with and without. And why do I have to put all the: [!ActivateConfig "illustro\clock" "clock.ini"] into Action=1 and respectively into Action=2 ? I can't tell, but seemingly it works. Vice versa -as you can see from the disabled settings- it doesn't. Anyway, I can work with now and that's a win.

Here the working code in full:

Code: Select all

[Rainmeter]
;Update=1000
Update=-1
AccurateText=1
Group=#RootConfig#
DynamicWindowSize=1
SkinWidth=(175*#Scale#)
SkinHeight=(256*#Scale#)
OnRefreshAction=[!ZPos -2]

[ShowSkins]
Meter=String
MeterImageName=#@#Images\Graph_II.png
;LeftMouseUpAction=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\network" "network.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"]
LeftMouseUpAction=[!ActivateConfig]

[HideMySkins]
Meter=String
MeterImageName=#@#Images\Graph_II.png
;LeftMouseUpAction=[!DeactivateConfig "illustro\clock" "clock.ini"][!DeactivateConfig "illustro\network" "network.ini"][!DeactivateConfig "illustro\disk" "1 disk.ini"]
LeftMouseUpAction=[!DeactivateConfig]


; ========= Variables ==========

[Variables]
Scale=0.2
; Scale Suggested Sizes
; Scale 0.0625 will match notification area icon size
; Scale 0.0625 will also match Windows 10 small taskbar icon size
; Scale 0.1 will match Windows 10 taskbar size


; DO NOT EDIT THESE

;Action=0
;Action1=[!ActivateConfig][!Redraw]
;Action0=[!DeactivateConfig][!Redraw]


Action=0
Action1=[!ActivateConfig "illustro\clock" "clock.ini"][!ActivateConfig "illustro\network" "network.ini"][!ActivateConfig "illustro\disk" "1 disk.ini"][!Redraw]
Action0=[!DeactivateConfig "illustro\clock" "clock.ini"][!DeactivateConfig "illustro\network" "network.ini"][!DeactivateConfig "illustro\disk" "1 disk.ini"][!Redraw]


; ========= Meters ==========

[Meter]
Meter=Image
ImageName=#@#Images\Graph_II.png
; ImageName=#@#Images\Rainstaller_256
; Alternate "Green" Icon
SolidColor=0,0,0,1
LeftMouseUpAction=[!SetVariable Action (1-#Action#)][!Update][#Action[#Action]]
TransformationMatrix=#Scale#;0;0;#Scale#;0;0
DynamicVariables=1

Thank you for all your help.

With kind regards,