It is currently April 19th, 2024, 7:23 pm

Centering skins?

Get help with installing and using Rainmeter.
mramnesia8@gmail.com
Posts: 8
Joined: May 1st, 2017, 2:25 am

Centering skins?

Post by mramnesia8@gmail.com »

Is that possible? I don't really see that option when I right click on a skin and checking its positioning :P
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Centering skins?

Post by Brian »

Use these options in your Rainmeter.ini file.

https://docs.rainmeter.net/manual-beta/settings/skin-sections/#WindowXY
https://docs.rainmeter.net/manual-beta/settings/skin-sections/#AnchorXY
Rainmeter Docs wrote:As an example, by setting WindowX, WindowY, AnchorX and AnchorY all to 50% the config will be truly centered in the primary monitor regardless of screen resolution or aspect ratio.
-Brian
mramnesia8@gmail.com
Posts: 8
Joined: May 1st, 2017, 2:25 am

Re: Centering skins?

Post by mramnesia8@gmail.com »

Does every skin itself has its own ini file, or is there like a master ini file somewhere that controls all skins? :P
mramnesia8@gmail.com
Posts: 8
Joined: May 1st, 2017, 2:25 am

Re: Centering skins?

Post by mramnesia8@gmail.com »

I realise now that was a stupid question :P
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Centering skins?

Post by Brian »

One master file for all skins: https://docs.rainmeter.net/manual-beta/settings/#FilesFolders

It is located in the following folder for normal installation: C:\Users\YourName\AppData\Roaming\Rainmeter
Or it will be located in your installation folder if using the portable option.

You can click the Edit Settings button in the Manage dialog.

-Brian
mramnesia8@gmail.com
Posts: 8
Joined: May 1st, 2017, 2:25 am

Re: Centering skins?

Post by mramnesia8@gmail.com »

Thank you so much :)
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Centering skins?

Post by Brian »

You're welcome.

One note is that if you use the method provided by the docs, if you happen to move that skin, those settings will no longer center your skin (unless you have unchecked the 'Save Position' or have unchecked the 'Draggable' option in Manage for that skin).

Another way to accomplish this is to use the !Move bang with a OnRefreshAction and manually center the skin whenever it is loaded or refreshed. However, you will have to manually figure out the size of your skin using some built-in variables - divide them in half, and use that calculation in your !Move bang. Not trivial, but might provide a better option for those cases in which you accidentally move the skin.

-Brian
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Centering skins?

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureCenter]
Measure=Calc
DynamicVariables=1
UpdateDivider=-1
Formula=MeasureCenter + 1
IfCondition=MeasureCenter > 0
IfTrueAction=[!Move "(#SCREENAREAWIDTH#/2-(#CURRENTCONFIGWIDTH#/2))" "(#SCREENAREAHEIGHT#/2-(#CURRENTCONFIGHEIGHT#/2))"]

[MeterText]
Meter=String
X=0
Y=0
StringAlign=Left
FontSize=25
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=I'm a centered skin