It is currently September 21st, 2019, 6:11 pm

Question on layouts

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Question on layouts

balala » March 10th, 2019, 6:24 pm

Hello everyone,

From time to time comes my turn to ask something. This is a such moment.
I've wrote a larger skins suite (I call it Mirage) which I'd like to upload on the forum. But when I wanted to create the installer, I ran into a problem: I'd like to place some skins onto the right side of the screen and create a layout with those skins into the position. So I dragged them close to the right edge of the screen. I saved the layout, but now I have a problem: what if the user who will want to install my skins, has a different screen resolution? Probably most of them will be in this situation. So the skins will have different positions, depending on the value of the resolution on the target computer. Is there any good way to create a layout which depends on the resolution of the screen on the computer where the suite is installed? what would be the best technique in a such case?

Thanks in advance.
User avatar
jsmorley
Developer
Posts: 19474
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Question on layouts

jsmorley » March 10th, 2019, 7:32 pm

I would manually edit the Layout, and for each [Section], use the various WindowX/WindowY and AnchorX / AnchorY settings that are available, which can be relative to any resolution screen, and can be a percentage.

https://docs.rainmeter.net/manual/settings/skin-sections/#WindowXY
https://docs.rainmeter.net/manual/settings/skin-sections/#AnchorXY

I would be tempted to encourage users not to "re-save" the Layout if they move things around or add / subtract what what is loaded, as that will destroy / replace those values with "current" values based on the particular screen resolution. I would tell them to save an entirely new Layout, but perhaps keep the original one intact, so they can get back to where you originally had things set up.
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question on layouts

balala » March 10th, 2019, 7:52 pm

jsmorley wrote:
March 10th, 2019, 7:32 pm
I would manually edit the Layout, and for each [Section], use the various WindowX/WindowY and AnchorX / AnchorY settings that are available, which can be relative to any resolution screen, and can be a percentage.

https://docs.rainmeter.net/manual/settings/skin-sections/#WindowXY
https://docs.rainmeter.net/manual/settings/skin-sections/#AnchorXY

I would be tempted to encourage users not to "re-save" the Layout if they move things around or add / subtract what what is loaded, as that will destroy / replace those values with "current" values based on the particular screen resolution. I would tell them to save an entirely new Layout, but perhaps keep the original one intact, so they can get back to where you originally had things set up.
I think this is what I was looking for. :o I have to admit I had no idea about these possibilities and now will have to go through them and read them carefully. But anyway thank you for the information. :thumbup: It's great!!!
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Question on layouts

Yincognito » March 10th, 2019, 7:54 pm

This is how I do it (in the saved layout):

Code: Select all

[MYiniMeter\Clock]
WindowX=194R
WindowY=616
Notice the R in the WindowX value. That's telling Rainmeter to position the skin relative to the right edge of the screen, as per here. On my Settings skin, which I want centered, I use:

Code: Select all

[MYiniMeter\Settings]WindowX=50%
WindowY=50%
AnchorX=50%
AnchorY=50%
and it goes to the center of the screen. After doing this, save the layout and include it within your skin package. If you want the user to not lose this positioning (assuming it doesn't delete things manually), just include a button in your suite to restore the default layout by using a bang like [!LoadLayout "your_default_layout_name_here"].
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question on layouts

balala » March 10th, 2019, 8:10 pm

Yincognito wrote:
March 10th, 2019, 7:54 pm
This is how I do it (in the saved layout):

Code: Select all

[MYiniMeter\Clock]
WindowX=194R
WindowY=616
Notice the R in the WindowX value. That's telling Rainmeter to position the skin relative to the right edge of the screen, as per here. On my Settings skin, which I want centered, I use:

Code: Select all

[MYiniMeter\Settings]WindowX=50%
WindowY=50%
AnchorX=50%
AnchorY=50%
and it goes to the center of the screen. After doing this, save the layout and include it within your skin package. If you want the user to not lose this positioning (assuming it doesn't delete things manually), just include a button in your suite to restore the default layout by using a bang like [!LoadLayout "your_default_layout_name_here"].
Yes, practically this is exactly what jsmorley said as well.
Thanks to both for the information.
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Question on layouts

Yincognito » March 10th, 2019, 8:20 pm

balala wrote:
March 10th, 2019, 8:10 pm
Yes, practically this is exactly what jsmorley said as well.
Thanks to both for the information.
Yep, sorry for the duplicate. Better more answers than none, right? :D
Well, it wasn't exactly a copy-paste after jsmorley though... :oops:
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question on layouts

balala » March 10th, 2019, 8:21 pm

Yincognito wrote:
March 10th, 2019, 8:20 pm
Yep, sorry for the duplicate. Better more answers than none, right? :D
Agree...
Yincognito wrote:
March 10th, 2019, 8:20 pm
Well, it wasn't exactly a copy-paste after jsmorley though... :oops:
I didn't say it was.
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question on layouts

balala » March 10th, 2019, 9:40 pm

One more question. If I save a layout with the skins positioned related to the right edge of the screen, if I open the settings, the positions are unaltered. But if I reload the layout, they are rewritten to absolute positions (getting WindowX=1678 instead of the previously existing WindowX=242R). The value is correct, summing them I get the width of the screen (in pixels), so I suppose for users with another screen resolution, the appropriate value is written there. Am I right?
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Question on layouts

Yincognito » March 10th, 2019, 10:26 pm

balala wrote:
March 10th, 2019, 9:40 pm
One more question. If I save a layout with the skins positioned related to the right edge of the screen, if I open the settings, the positions are unaltered. But if I reload the layout, they are rewritten to absolute positions (getting WindowX=1678 instead of the previously existing WindowX=242R). The value is correct, summing them I get the width of the screen (in pixels), so I suppose for users with another screen resolution, the appropriate value is written there. Am I right?
They shouldn't be rewritten. At least this doesn't happen in my case, even if I do exactly as you did. One more thing though - I don't know if this is critical to this working or not, but I did this step too, just in case: right click your skins and choose Settings -> Position -> From Right. It might be the same as editing the layout, or not, but this, coupled with layout editing and then saving it (if needed, of course) works for me.

Let me know if it solved the issue.

EDIT: Just checked, choosing Settings -> Position -> From Right does the same (aka append the R to the end of the skin's position) as manually editing Rainmeter.ini. Of course, if your skin is moved (either manually or because of a bang in your skin), its position is changed in Rainmeter.ini, but it keeps its R at the end, as long as the above setting is checked. And, of course, moving the skin should not affect in any way the saved layout, that's pretty much obvious.
User avatar
jsmorley
Developer
Posts: 19474
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Question on layouts

jsmorley » March 11th, 2019, 12:29 am

If you use

WindowX=100%
AnchorX=R

That will align a skin to the right side of your screen, no matter the resolution.

I never said that anything would change the "saved layout". Of course not. What I said, and what I meant, is that if you load this layout, and then move the skin, the value for WindowX will change in the current Rainmeter.ini to reflect the new position, and if you then save that as the same Layout you loaded, the original settings are lost.