It is currently March 28th, 2024, 11:25 pm

Default Settings

Changes made during the Rainmeter 4.4 beta cycle.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Default Settings

Post by jsmorley »

We have added the ability to set default / starting values for the options defined in [ConfigName] in Rainmeter.ini.

These will include all options for "position", as well as the other options like "Draggable" and "StayOnScreen".

This does not include support for Active (which would not be logical at all), LoadOrder (which is not logical for a single skin), or Group or DragGroup, which can already be defined at the skin level.

See Reference / Skins / [Rainmeter] Section / Default Settings in the documentation for details.


1.png

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
DefaultWindowX=2020
DefaultWindowY=100

[Variables]

[MeterBack]
Meter=Shape
Shape=Rectangle 0.5,0.5,300,100 | StrokeWidth 1 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255

[MeterPosition]
Meter=String
X=151
Y=51
StringAlign=CenterCenter
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=X:#CURRENTCONFIGX# | Y:#CURRENTCONFIGY#
The very first time this skin is loaded, it will use the DefaultWindowX and DefaultWindowY values defined in the skin. Those values will be set and written in the [ConfigName] section of the skin in Rainmeter.ini. If the user of the skin moves the skin subsequent to that, the user's changes will be written and used from then on. In that sense, this is very much similar to a Layout, but without any external Layout file.


2.png


Probably the biggest advantage is the ability to distribute a skin, forcing some starting position and other settings, while not replacing all of the user's loaded skins with yours, which would be the result of using a Layout. Much of this can be done today with various skin !bangs used in OnRefreshAction in [Rainmeter], but it can be pretty complicated and geeky to force this to only be done once, when the skin is loaded for the first time, and not on subsequent refresh and reload. In general, don't "force" your desires on an end-user without good reason. Once they load your skin, it's theirs, not yours...
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Default Settings

Post by SilverAzide »

Awesome! Thanks! :rosegift:

This should be great for "welcome" skins that you might want the user to see centered the first time it is used, but after that the user can place it where ever he/she prefers. Also great for skins that are intended to "dock" or act like sidebars, and for setting Z order positioning so skins can be "below" windows by default, or for positioning relative to the right side of the screen instead of the left so changing screen resolutions won't mess up your positioning, etc... all without requiring a layout that will mess up the user's existing skins.

:thumbup:
Gadgets Wiki GitHub More Gadgets...
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Default Settings

Post by Jeff »

Goodnight !Move which was able to set the skin's WindowXY in pixels but not in percentage (i mean technically the section in rainmeter.ini would be percentages if at one time you edited that part in the .ini to include a % sign).
Good morning DefaultWindowXY/DefaultAnchorXY=50% DefaultSavePosition=0 which I'll use everywhere.
Tested all the options and they worked. I really love this feature despite it only working once the skin is loaded the first time, that's why the DefaultSavePosition=0.
SilverAzide wrote: November 16th, 2019, 6:31 pm This should be great for "welcome" skins that you might want the user to see centered the first time it is used, but after that the user can place it where ever he/she prefers.
The default rainmeter.ini that comes/is written when you load Rainmeter already has the percentage stuff that makes it centered, but I agree, adding these new options to the illustro skins would teach new users about how useful this is.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Default Settings

Post by jsmorley »

Yes, the following shows how you could center a skin, and have it persistently stay centered on each reload / refresh.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
DefaultWindowX=50%
DefaultWindowY=50%
DefaultAnchorX=50%
DefaultAnchorY=50%
DefaultSavePosition=0

[Variables]

[MeterBox]
Meter=Image
W=300
H=150
SolidColor=255,255,255,255
User avatar
Cariboudjan
Posts: 264
Joined: May 12th, 2019, 8:55 am

Re: Default Settings

Post by Cariboudjan »

Thanks. I don't even need to include a layout at all with this. Very clever idea.