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.
It is currently April 20th, 2024, 3:12 am
Question on layouts
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Question on layouts
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.
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.
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Question on layouts
I think this is what I was looking for. 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. It's great!!!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.
-
- Rainmeter Sage
- Posts: 7128
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Question on layouts
This is how I do it (in the saved layout):
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:
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"].
Code: Select all
[MYiniMeter\Clock]
WindowX=194R
WindowY=616
Code: Select all
[MYiniMeter\Settings]WindowX=50%
WindowY=50%
AnchorX=50%
AnchorY=50%
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Question on layouts
Yes, practically this is exactly what jsmorley said as well.Yincognito wrote: ↑March 10th, 2019, 7:54 pm This is how I do it (in the saved layout):
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\Clock] WindowX=194R WindowY=616
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"].Code: Select all
[MYiniMeter\Settings]WindowX=50% WindowY=50% AnchorX=50% AnchorY=50%
Thanks to both for the information.
-
- Rainmeter Sage
- Posts: 7128
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Question on layouts
Agree...Yincognito wrote: ↑March 10th, 2019, 8:20 pm Yep, sorry for the duplicate. Better more answers than none, right?
I didn't say it was.
-
- Rainmeter Sage
- Posts: 16147
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Question on layouts
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?
-
- Rainmeter Sage
- Posts: 7128
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Question on layouts
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.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?
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.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Question on layouts
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.
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.