It is currently May 21st, 2024, 7:29 pm

Help: Switching wallpapers with a button

Get help with creating, editing & fixing problems with skins
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 5:43 pm You came pretty close, nice attempt. Here is my code, you can compare the differences and see where you were "off track". You weren't much wrong though, and almost nailed it:
Yeah well, I was missing the sliding part...

There is still a need to selectively disable / enable the mouse actions apparently, as otherwise "notepad" will get executed when clicking the opaque pixels of the panel even though they are "hidden" under the button.
Actually I don't the sliding panel to toggle anything, it's only visual. So no problem.

Thanks agin ! Now I can add the rest and tweak it a bit.
So is this possible to have another meter sliding from underneath the sliding panel, but only when and after that the panel is completely out ?
To see the idea I join a pic : I'd want the orange "line" (Launchers Connector.png) to slide down, from the sliding panel, and then my programs launchers to appear.
The same container strategy would work ?
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7299
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 6:09 pmSo is this possible to have another meter sliding from underneath the sliding panel, but only when and after that the panel is completely out ?
To see the idea I join a pic : I'd want the orange "line" (Launchers Connector.png) to slide down, from the sliding panel, and then my programs launchers to appear.
The same container strategy would work ?
You mean right after the panel is fully sliden out, the connector line automatically slides down, and when the connector line is fully sliden out, the launchers automatically slide to the right from behind the connector line?

If so, while it would certainly be a nice effect, the implementation is going to be a bit problematic, as containers cannot be nested, according to the manual. But yeah, normally you'd use the same container strategy, i.e. button's "background" container for the panel, the panel container for the connector line, and the connector line container for the launchers. That involves nesting though, so...

Anyway, is this what you're after? If you do, I can try to explore some workaround possibilities, if any.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

You mean right after the panel is fully sliden out, the connector line automatically slides down, and when the connector line is fully sliden out, the launchers automatically slide to the right from behind the connector line?
I just need the connector to slide down, not the launchers. I'll make them "appear" with [!ShowMeterGroup].

Okay i've manage to come up with this code, I made a container and all.
But not working, it actually modifies the sliding of the sliding panel. I don't get why ?

Code: Select all

[Variables]
@IncludeConfig=#@#\Config.inc
State=0
MyVar=0
StateA=1
Speed=2
Repeat=105
Wait=5
Offset=105
U=[!UpdateMeasure "MeasureSlider"][!UpdateMeterGroup SlidingMeters][!Redraw]
StateB=1
Speed=2
Repeat=221
Wait=5
OffsetY=-221
U1=[!UpdateMeasure "MeasureSlider2"][!UpdateMeterGroup SlidingMeters2][!Redraw]

=== MEASURES ===================================================================
--- Measure Sliding panel ------------------------------------------------------
[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut,#Speed#,#Repeat# | Wait #Wait#
SlideOut=[!SetVariable StateA "2"][!SetVariable Offset (#Offset#-1)]#U#
ActionList2=Repeat SlideIn,#Speed#,#Repeat# | Wait #Wait#
SlideIn=[!SetVariable StateA "1"][!SetVariable Offset (#Offset#+1)]#U#
DynamicVariables=1

--- Measure Sliding Connector --------------------------------------------------
[MeasureSlider2]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideDown,#Speed#,#Repeat# | Wait #Wait#
SlideDown=[!SetVariable StateB "2"][!SetVariable OffsetY (#OffsetY#-1)]#U1#
ActionList2=Repeat SlideUp,#Speed#,#Repeat# | Wait #Wait#
SlideUp=[!SetVariable StateB "1"][!SetVariable OffsetY (#OffsetY#+1)]#U1#
DynamicVariables=1

--- Measure Button -------------------------------------------------------------
[MeasureMyVar]
Measure=Calc
Formula=#MyVar#
IfCondition=(#CURRENTSECTION#=1)
UpdateDivider=-1
DynamicVariables=1

=== METERS ===================================================================
--- Meters Sliding Panel ------------------------------------------------------

[MeterContainer]
Meter=Image
ImageName=#@#\Images\Large Launchers2\Container.png
X=0
Y=0
Antialias=1
DynamicVariables=1

[MeterSlidingPanel]
Group=SlidingMeters
Container=MeterContainer
Meter=Image
ImageName=#@#\Images\Large Launchers2\Sliding Panel.png
X=(#Offset#)r
Y=0r
Antialias=1
DynamicVariables=1

--- Meter Main Button --------------------------------------------------------

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Large Launchers2\Button #MyVar#.png
X=123
Y=0
Antialias=1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop #StateA#"][!CommandMeasure MeasureSlider "Execute #StateA#"][!CommandMeasure MeasureSlider "Stop #StateB#"][!CommandMeasure MeasureSlider "Execute #StateB#"][!SetVariable MyVar "(1-#MyVar#)"][!UpdateMeasure "MeasureMyVar"][!Redraw]
DynamicVariables=1

--- Meters Sliding Connector --------------------------------------------------

[MeterContainer2]
Meter=Image
ImageName=#@#\Images\Large Launchers2\Container2.png
Y=25r
Antialias=1
DynamicVariables=1

[MeterSlidingConnector]
Group=SlidingMeters2
Container=MeterContainer2
Meter=Image
Y=(#OffsetY#)r
ImageName=#@#\Images\Large Launchers2\Launchers Connector.png
Antialias=1
DynamicVariables=1
The contianer is placed exactly where I want the meter to be shown. It has the exact same size as the meter (16x221) starting directly from underneath the sliding panel.
User avatar
Yincognito
Rainmeter Sage
Posts: 7299
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 7:28 pmOkay i've manage to come up with this code, I made a container and all.
But not working, it actually modifies the sliding of the sliding panel. I don't get why ?

The contianer is placed exactly where I want the meter to be shown. It has the exact same size as the meter (16x221) starting directly from underneath the sliding panel.
Assuming you did everything else right, it's modifying the sliding of the panel because although you did correctly create additional State and Offset (I'm not sure about their values though) for the connector line, you didn't create an additional (and different in name) Repeat variable. Point is, having Repeat=105 and later on Repeat=221 (i.e. same variable name) is just going to repeat each step of the panel's sliding 221 times. The 105 value is simply replaced by the following 221 value, since it's the same variable name. It should have been something like Repeat=105 and Repeat2=221, and you'd use #Repeat2# in the ActionTimer measure for the connector line.

Let me try something on my own code in the meantime.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 7:52 pm Assuming you did everything else right, it's modifying the sliding of the panel because although you did correctly create additional State and Offset (I'm not sure about their values though) for the connector line, you didn't create an additional (and different in name) Repeat variable. Point is, having Repeat=105 and later on Repeat=221 (i.e. same variable name) is just going to repeat each step of the panel's sliding 221 times. The 105 value is simply replaced by the following 221 value, since it's the same variable name. It should have been something like Repeat=105 and Repeat2=221, and you'd use #Repeat2# in the ActionTimer measure for the connector line.

Let me try something on my own code in the meantime.
Oh yeah right ! I'll modify that.

EDIT: Not changing anything, problem must be somewhere else...
EDIT 2 : I join you the .png if this could help.
EDIT 3 : Just had an idea, can combining both container into only one would help ? Then it's just placing the corresponding meters so they slide into the "part" of the container we need them to be.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7299
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 7:55 pm Oh yeah right ! I'll modify that.

EDIT: Not changing anything, problem must be somewhere else...
EDIT 2 : I join you the .png if this could help.
EDIT 3 : Just had an idea, can combining both container into only one would help ? Then it's just placing the corresponding meters so they slide into the "part" of the container we need them to be.
Yeah, no need to, you can replace them while "merging" this code with yours:
Test_1.0.0.rmskin
There is some commented code in the .ini, but that's just some leftovers from previous talks - you can safely delete it. As for the rest, it does things as I thought you would like them to happen - let me know if it's what you'd like. Also, some adjustments to the position / size / repeat of the corresponding PNGs / measures / meters might be needed, as the top side of the container is a "horizontal line" (i.e. at 0 degrees) and when the connector slides out (but especially when it slides back in) it doesn't "fit" visually with the 135 degrees of the angular left side of the panel - you'll see what I mean. The adjustment would probably consist in "enlarging" the whole thing / process to 0,0 instead of 0,25 as it is now, and edit the PNG towards the top in order for the shape to be angular instead of at a right angle.

Some variables and stuff are probably redundant and have no significant purpose in my code (I could have used the same State, Speed and Wait for both the panel and the connector, for example), but I left them there for consistency. The variables / names ending in C are for the connector.

Let me know what you think.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 9:07 pm Yeah, no need to, you can replace them while "merging" this code with yours:
Test_1.0.0.rmskin
There is some commented code in the .ini, but that's just some leftovers from previous talks - you can safely delete it. As for the rest, it does things as I thought you would like them to happen - let me know if it's what you'd like. Also, some adjustments to the position / size / repeat of the corresponding PNGs / measures / meters might be needed, as the top side of the container is a "horizontal line" (i.e. at 0 degrees) and when the connector slides out (but especially when it slides back in) it doesn't "fit" visually with the 135 degrees of the angular left side of the panel - you'll see what I mean. The adjustment would probably consist in "enlarging" the whole thing / process to 0,0 instead of 0,25 as it is now, and edit the PNG towards the top in order for the shape to be angular instead of at a right angle.

Some variables and stuff are probably redundant and have no significant purpose in my code (I could have used the same State, Speed and Wait for both the panel and the connector, for example), but I left them there for consistency. The variables / names ending in C are for the connector.

Let me know what you think.
Well, just tried it, without merging codes first, it looks very cool, and as I pictured it!
I'll see if I need to ajust things after merging.
As for the connector when sliding back in, I see what u meant, but it is pretty quick, so we barely see it actually.
I'll see if I adjust the PNG as you said.
User avatar
Yincognito
Rainmeter Sage
Posts: 7299
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 9:24 pm Well, just tried it, without merging codes first, it looks very cool, and as I pictured it!
I'll see if I need to ajust things after merging.
As for the connector when sliding back in, I see what u meant, but it is pretty quick, so we barely see it actually.
I'll see if I adjust the PNG as you said.
It actually works with your images as well. It's your choice.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7299
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 11th, 2020, 9:24 pm Well, just tried it, without merging codes first, it looks very cool, and as I pictured it!
I'll see if I need to ajust things after merging.
As for the connector when sliding back in, I see what u meant, but it is pretty quick, so we barely see it actually.
I'll see if I adjust the PNG as you said.
Well, I just made the adjustments needed.
The connector container PNG:
ContainerC2.png
The code adjustments:
- RepeatC=231
- OffsetC=-206
- Y=0 in [MeterContainerC]
That's all, folks. :D
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 11th, 2020, 9:26 pm It actually works with your images as well. It's your choice.
Yeah working perfectly, I've added the rest of my launchers.
Added a MyVar to have a delay for the launchers to appear and to switch the main "button" (just an image now not a button).
See the result for yourself.
You do not have the required permissions to view the files attached to this post.