It is currently April 19th, 2024, 8:58 pm

Importing a layout on top of an old one / global layout settings

Get help with creating, editing & fixing problems with skins
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Importing a layout on top of an old one / global layout settings

Post by Krainz »

Hi,

I'm developing a package of skins, and I'm conflicted between having one skin with dozens of meters or dozens of skins with only a few meters.

The design issue is: with a full-fledged skin, whenever the end user loads the skin into another layout profile, the X and Y positions of the elements (meters) are all set with no need to be configured.

However, with dozens of skins, the X and Y positions of those skins would only be determined in the layout configuration, so if the user loads a previous layout, or creates a new one, the UI elements (now skins) would be with incorrect X and Y positions.

What makes me choose between the two is that several skins apparently works more fluidly with Rainmeter as opposed to a unified skin with many many meters.

So, is there a way of loading a new layout on top of an old one? Like, if the user downloads my project and reverts to an old layout they had been using before, can they just double click something and "import" the X and Y positions of my skins so they don't get misplaced?

Or maybe saving that X and Y positioning information "globally" so the skins would be in the correct position no matter what layout the user loads or creates?
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Importing a layout on top of an old one / global layout settings

Post by balala »

Krainz wrote: June 24th, 2019, 9:07 pm So, is there a way of loading a new layout on top of an old one? Like, if the user downloads my project and reverts to an old layout they had been using before, can they just double click something and "import" the X and Y positions of my skins so they don't get misplaced?

Or maybe saving that X and Y positioning information "globally" so the skins would be in the correct position no matter what layout the user loads or creates?
No, unfortunately the answer to both questions is "no, there is not". When loading a layout, the old one is unloaded. Nor the skins, nor their position or settings are not kept. This is one of the purposes of layouts.
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Importing a layout on top of an old one / global layout settings

Post by Krainz »

Is there a way to write on the rainmeter.ini settings through a bang then?

This way, every time the skin is loaded, it would write the most optimal settings to rainmeter.ini and then reload all skins.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Importing a layout on top of an old one / global layout settings

Post by balala »

Krainz wrote: June 26th, 2019, 1:43 pm Is there a way to write on the rainmeter.ini settings through a bang then?
Of course. Use the !WriteKeyValue bang. For instance the following bang writes to 0 (third parameter) the MyParameter option (second parameter of the bang) of the MyConfig section (first parameter) of Rainmeter.ini (last parameter): [!WriteKeyValue MyConfig MyParameter "0" "#SETTINGSPATH#Rainmeter.ini"].
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Importing a layout on top of an old one / global layout settings

Post by Krainz »

Thanks balala!

A final question, on the matter of writing a keyvariable to rainmeter.ini every time the skin is loaded, would it visibly affect performance?
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Importing a layout on top of an old one / global layout settings

Post by balala »

Krainz wrote: June 26th, 2019, 2:10 pm A final question, on the matter of writing a keyvariable to rainmeter.ini every time the skin is loaded, would it visibly affect performance?
I'm not sure. You have to try it out.
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Importing a layout on top of an old one / global layout settings

Post by qwerky »

Krainz wrote: June 26th, 2019, 1:43 pm Is there a way to write on the rainmeter.ini settings through a bang then?

This way, every time the skin is loaded, it would write the most optimal settings to rainmeter.ini and then reload all skins.
Be sure not to create an endless loop...