It is currently March 28th, 2024, 4:42 pm

[Suggestion] Anchoring skin from the top-right

Report bugs with the Rainmeter application and suggest features.
User avatar
redsaph
Posts: 30
Joined: October 24th, 2013, 8:15 am

[Suggestion] Anchoring skin from the top-right

Post by redsaph »

Hello!

So currently all the skins "anchor" at the top-left corner, meaning that coordinate (0,0) is at the top-left corner and skins grow to the right.
It would be nice if there was a mode for the skins to "anchor" at the top-right corner, meaning that coordinate (0,0) is at the top-right corner. Example, an object at (150,0) from this top-right anchoring would be offset 150 pixels from the right (= with the current implementation, it would be like (-150,0) but that isn't possible).

I wrote something related to this years ago but I've never gotten around to sharing it here. It would be great if skins can expand to the left since it would make right aligned skins easier to make.

What do you guys think?
Last edited by redsaph on July 30th, 2019, 2:21 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Suggestion] Anchoring skin from the top-right

Post by balala »

redsaph wrote: July 29th, 2019, 5:08 pm What do you guys think?
But there is a such option. You have to edit the Rainmeter.ini file (available through a right click to the Rainmeter icon, then click Edit settings). See this description: https://docs.rainmeter.net/manual/settings/skin-sections/#AnchorXY
User avatar
redsaph
Posts: 30
Joined: October 24th, 2013, 8:15 am

Re: [Suggestion] Anchoring skin from the top-right

Post by redsaph »

balala wrote: July 29th, 2019, 5:40 pm But there is a such option. You have to edit the Rainmeter.ini file (available through a right click to the Rainmeter icon, then click Edit settings). See this description: https://docs.rainmeter.net/manual/settings/skin-sections/#AnchorXY
That's for positioning the skin in relation to the monitor/window. What I was looking for is positioning the meters inside a skin such that the origin (0,0) begins at the top-right corner of the skin.

Image

The current implementation for the skin's positioning is like on quadrant 4 (but instead of negative y-values when going downwards, it's all positive).

My suggestion was to have an option to set a property inside the [Rainmeter] section of a skin that would allow it to have meters positioned like in quadrant 3 (but probably in absolute values).
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Suggestion] Anchoring skin from the top-right

Post by balala »

redsaph wrote: July 29th, 2019, 6:12 pm That's for positioning the skin in relation to the monitor/window. What I was looking for is positioning the meters inside a skin such that the origin (0,0) begins at the top-right corner of the skin.

Image

The current implementation for the skin's positioning is like on quadrant 4 (but instead of negative y-values when going downwards, it's all positive).

My suggestion was to have an option to set a property inside the [Rainmeter] section of a skin that would allow it to have meters positioned like in quadrant 3 (but probably in absolute values).
Sorry I misunderstood you. No approach for this.
User avatar
Axinoe
Posts: 14
Joined: April 27th, 2018, 10:52 pm

Re: [Suggestion] Anchoring skin from the top-right

Post by Axinoe »

Using DynamicWindowSize=1 and a skin that continuously grows in length, setting AnchorX to 100% actually does anchor the skin on the top right. The skin is growing to the left instead of to the right.
User avatar
redsaph
Posts: 30
Joined: October 24th, 2013, 8:15 am

Re: [Suggestion] Anchoring skin from the top-right

Post by redsaph »

Axinoe wrote: July 29th, 2019, 6:44 pm Using DynamicWindowSize=1 and a skin that continuously grows in length, setting AnchorX to 100% actually does anchor the skin on the top right. The skin is growing to the left instead of to the right.
How can I set AnchorX to 100% on my skin by default (without editing Rainmeter.ini)? Do you have a sample that I can take a look at?
User avatar
Axinoe
Posts: 14
Joined: April 27th, 2018, 10:52 pm

Re: [Suggestion] Anchoring skin from the top-right

Post by Axinoe »

You could probably write to Rainmeter.ini using !WriteKeyValue, but I'm not sure how good of an idea that is.
Edit Rainmeter.ini and add AnchorX=100% under the skin and it should work.

Code: Select all

[Rainmeter]
Update=32
DynamicWindowSize=1

[MeasureCalc]
Measure=Calc
Formula=MeasureCalc+1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,([MeasureCalc]),50
DynamicVariables=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: [Suggestion] Anchoring skin from the top-right

Post by eclectic-tech »

Demonstrating Axinoe's suggestion to set the skin AnchorX @ 100%. Using RunOnce (JSMorley's idea!) it is a simple solution.

Code: Select all

[Rainmeter]
Update=32
DynamicWindowSize=1

[RunOnce]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!WriteKeyValue #CurrentConfig# AnchorX 100% "#SettingsPath#Rainmeter.ini"][!Refresh]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnce]

[MeasureLoop]
Measure=Loop
StartValue=0
EndValue=200
LoopCount=0
; PingPong
IfCondition=MeasureLoop=200
IfTrueAction=[!SetOption MeasureLoop InVertMeasure 1][!UpdateMeasure MeasureLoop]
IfCondition2=MeasureLoop=0
IfTrueAction2=[!SetOption MeasureLoop InVertMeasure 0][!UpdateMeasure MeasureLoop]

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,(50+[MeasureLoop]),(50+[MeasureLoop]),10 | Fill Color (55+[MeasureLoop]),(140-([MeasureLoop]*0.5)),(255-([MeasureLoop]*0.5))
DynamicVariables=1
ar2.gif
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: [Suggestion] Anchoring skin from the top-right

Post by eclectic-tech »

Here is an example using string meters.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=255,255,255,100

[RunOnce]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!WriteKeyValue #CurrentConfig# AnchorX 100% "#SettingsPath#Rainmeter.ini"][!Refresh]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnce]

[MeterString]
Meter=String
Text=Right-anchored skin in a dynamically resized window, based on the length of the text.
FontWeight=500
FontColor=0,0,0
FontSize=12
DynamicVariables=1
; Documentation: https://docs.rainmeter.net/manual-beta/meters/string/

[String1]
Meter=String
X=r
Y=R
Text=- STRING 1 -
LeftMouseUpAction=[!SetOption MeterString Text "Right-anchored skin in a dynamically resized window, based on the length of the text."][!UpdateMeter MeterString][!Redraw]

[String2]
Meter=String
X=r
Y=R
Text=- STRING 2 -
LeftMouseUpAction=[!SetOption MeterString Text "Right-anchored skin with short text."][!UpdateMeter MeterString][!Redraw]

arstring.gif
Click to animate...
User avatar
redsaph
Posts: 30
Joined: October 24th, 2013, 8:15 am

Re: [Suggestion] Anchoring skin from the top-right

Post by redsaph »

Thank you everyone, this looks exactly what I was looking for! :)
Post Reply