It is currently March 29th, 2024, 10:57 am

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 »

balala wrote: June 5th, 2020, 7:29 am There are two skins: NewFolder\Large Launchers5\Large Launchers 5.ini and NewFolder\Smal Launchers2\Saml Launcher 2.ini. Which of them? Or you have the same question related to both?
Oh, the Small Launchers 2 is a skin you've already helped me with a week ago.
It's for the Large Launchers 5, the most recent one.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 5th, 2020, 12:11 pm It's for the Large Launchers 5, the most recent one.
Alright. Now that we know which skin to work with, let's see if I understood what you'd like to achieve. Am I correct when I believe you'd like to keep the first button (in this case the button of the [MeterImage] meter) unmoved when you click it, either to reveal, or to hide the subsequent meters?
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 »

balala wrote: June 5th, 2020, 5:30 pm Alright. Now that we know which skin to work with, let's see if I understood what you'd like to achieve. Am I correct when I believe you'd like to keep the first button (in this case the button of the [MeterImage] meter) unmoved when you click it, either to reveal, or to hide the subsequent meters?
Exactly.
The triggering is working, but for an unknown reason the button changes its position on each click.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 5th, 2020, 5:34 pm for an unknown reason the button changes its position on each click.
It changes because it is positioned relatively to the previous meter (in this case to [MeterConnector2]). The only thing you have to do is to modify the X option of the [MeterImage] meter to X=252.
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 »

balala wrote: June 5th, 2020, 5:37 pm It changes because it is positioned relatively to the previous meter (in this case to [MeterConnector2]). The only thing you have to do is to modify the X option of the [MeterImage] meter to X=252.
Thanks, as you wrote this, I saw that I wasn't able to move the skin (when button is "off") to the right edge of my screen because of the Relative positionning. Working well now.
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 »

balala wrote: June 5th, 2020, 5:37 pm It changes because it is positioned relatively to the previous meter (in this case to [MeterConnector2]). The only thing you have to do is to modify the X option of the [MeterImage] meter to X=252.
I'm trying to have a delay between the visual change of the button and the others meters to appear on the click.
But if I change the order of the MouseAction and place it after the UpdateMEasure of the button it doesn't work.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 5th, 2020, 5:45 pm I'm trying to have a delay between the visual change of the button and the others meters to appear on the click.
But if I change the order of the MouseAction and place it after the UpdateMEasure of the button it doesn't work.
But there already is a delay, at least when you click to show the meters, between the click and when the meters ([MeterLauncher1] and [MeterLauncher2], [MeterLauncherIcon1] and [MeterLauncherIcon2], respectively [MeterLauncherText1] and [MeterLauncherText2]) are shown. This delay is done by the [!Delay "300"] bang of the MouseAction0 variable.
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 »

balala wrote: June 5th, 2020, 6:26 pm But there already is a delay, at least when you click to show the meters, between the click and when the meters ([MeterLauncher1] and [MeterLauncher2], [MeterLauncherIcon1] and [MeterLauncherIcon2], respectively [MeterLauncherText1] and [MeterLauncherText2]) are shown. This delay is done by the [!Delay "300"] bang of the MouseAction0 variable.
I know. I would also like delays like that :
Click -> Button changes visual -> delay -> MeterConnector 1 & 2 appear -> delay (the one that already exists) -> all the MeterLaunchers 1 & 2 appear
and the same in reverse on the next click.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 5th, 2020, 7:16 pm I know. I would also like delays like that :
Click -> Button changes visual -> delay -> MeterConnector 1 & 2 appear -> delay (the one that already exists) -> all the MeterLaunchers 1 & 2 appear
and the same in reverse on the next click.
Here is a solution. For first, replace the MouseAction0 and MouseAction1 variables into the [Variables] section with the following ones and also add the Wait variable (which as I hope you figured it out, is the applied delay time):

Code: Select all

[Variables]
...
Wait=300
MouseAction0=[!SetVariable MyVar "1"][!UpdateMeasure "MeasureMyVar"][!UpdateMeter "MeterImage"][!Redraw][!Delay "#Wait#"][!ShowMeterGroup "Connectors"][!Redraw][!Delay "#Wait#"][!ShowMeterGroup "Launchers"][!ShowMeterGroup "LauncherIcons"][!ShowMeterGroup "LauncherTexts"][!Redraw]
MouseAction1=[!SetVariable MyVar "0"][!UpdateMeasure "MeasureMyVar"][!UpdateMeter "MeterImage"][!Redraw][!Delay "#Wait#"][!HideMeterGroup "Launchers"][!HideMeterGroup "LauncherIcons"][!HideMeterGroup "LauncherTexts"][!Redraw][!Delay "#Wait#"][!HideMeterGroup "Connectors"][!Redraw]
Now modify the LeftMouseUpAction option of the [MeterImage] meter, to this: LeftMouseUpAction=[#MouseAction[#MyVar]].

Two small comments:
  • We don't have the Config.inc file, added into the @IncludeConfig=#@#\Config.inc option of the [Variables] section. Don't know what is its content, but we don't have, because you didn't include it into the posted package (just as a side note, I have no idea how have you done this, because if this file has been there when you've created the package, there is no way to not include it, so I just suppose you don't have it either).
  • The #@# variable already contains a backslash, no need to add one more. So the @IncludeConfig=#@#\Config.inc option a little bit simpler should be @IncludeConfig=#@#Config.inc. Not a problem if you're using it, but neither needed. Details in PS of this post: https://forum.rainmeter.net/viewtopic.php?f=5&t=20840&p=111157#p111157
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 »

balala wrote: June 5th, 2020, 8:18 pm Here is a solution. For first, replace the MouseAction0 and MouseAction1 variables into the [Variables] section with the following ones and also add the Wait variable (which as I hope you figured it out, is the applied delay time):
Now modify the LeftMouseUpAction option of the [MeterImage] meter, to this: LeftMouseUpAction=[#MouseAction[#MyVar]].
Working fine. I just placed the SetVariable and Update Measure at the end of the Mouse Action 1 since I want the the visual switch of teh button to happen last.
Thanks.
Two small comments:
  • We don't have the Config.inc file, added into the @IncludeConfig=#@#\Config.inc option of the [Variables] section. Don't know what is its content, but we don't have, because you didn't include it into the posted package (just as a side note, I have no idea how have you done this, because if this file has been there when you've created the package, there is no way to not include it, so I just suppose you don't have it either).
Yeah I forgot to include it when creating the package. (I'm not sure how to easily create a package; I usually just duplicate the skin and copy all the files I need into the folder since the Rainmeter "create a package" doesn't do it). Anyway the config just has some "links" to programs, images files and strings text in order to gain some time and also to easily tweak the skins.
[*]The #@# variable already contains a backslash, no need to add one more. So the @IncludeConfig=#@#\Config.inc option a little bit simpler should be @IncludeConfig=#@#Config.inc. Not a problem if you're using it, but neither needed. Details in PS of this post: https://forum.rainmeter.net/viewtopic.php?f=5&t=20840&p=111157#p111157[/list]
Okay good to know, I copied it from the first skin I found when I started Rainmeter and never changed it.