Page 1 of 2
AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 2:06 pm
by Ashtefere
As stated.
Tested on latest beta with latest windows. Rainmeter skin doesn't change its behaviour at all with any AnchorX/AnchorY setting, as if it is ignored.
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 2:26 pm
by jsmorley
Need to know what you are trying to accomplish. AnchorX and AnchorY certainly work, but are used in conjunction with WindowX and WindowY.
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 2:58 pm
by Ashtefere
I just checked again.
What
doesnt work:
Rainmeter.ini
Skin Bang
Code: Select all
[!Move "#WORKAREAWIDTH#/2" "#WORKAREAHEIGHT#/2" targetSkin]
or
This results in:
What
does work:
Code: Select all
AnchorX=50%
AnchorY=50%
WindowX=50%
WindowY=50%
This results in:
I would assume that the !Move bang will move the skin by it's anchor. Is this not the intended behavior?
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:15 pm
by jsmorley
Let us dig into this... It's possible that !Move does not take AnchorX/AnchorY into consideration.
In the meantime, I'd be tempted to do something like:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureMove]
Measure=Calc
UpdateDivider=-1
OnUpdateAction=[!Move "((#SCREENAREAWIDTH#/2)-(#CURRENTCONFIGWIDTH#/2))" "((#SCREENAREAHEIGHT#/2)-(#CURRENTCONFIGHEIGHT#/2))"]
DynamicVariables=1
[MeterImage]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255
I put the !Move in an OnUpdateAction in a measure in the skin, rather than in [Rainmeter] as an OnRefreshAction, so it will be able to know the value of #CURRENTCONFIGWIDTH# / #CURRENTCONFIGHEIGHT#, which must be used "dynamically", and [Rainmeter] can't do that.
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:21 pm
by jsmorley
Here is a trick that isn't commonly known...
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!Move "(([#SCREENAREAWIDTH]/2)-([#CURRENTCONFIGWIDTH]/2))" "(([#SCREENAREAHEIGHT]/2)-([#CURRENTCONFIGHEIGHT]/2))"]
[MeterImage]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255
Note that in this case I HAVE put the action into an OnRefreshAction in the [Rainmeter] section. Why does this work, when I stated above that #CURRENTCONFIGWIDTH# / #CURRENTCONFIGHEIGHT# can't be "dynamic" in the [Rainmeter] section?
https://docs.rainmeter.net/manual/variables/nesting-variables/
It's because all
[#NestedVariables] are always dynamically resolved when they are used in a bang, and so are always used in a "dynamic" way, even in the [Rainmeter] section of the skin. Regular
#Variables# are not by nature dynamic, and must be used with
DynamicVariables=1 in measures or meters, and can't be dynamic in [Rainmeter].
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:25 pm
by Ashtefere
I would do this, but unfortunately that is now how the skin needs to work.
I have the top bar skin with an button (meter), that when hovered with the mouse should do this:
The skin should center it's X position on the hovered meter.
This works fine on any skins that have a fixed with (I just do some math) but for dynamic width skins there is not a solution.
!Move taking AnchorX into consideration would solve this (and seems like this should be the actual behaviour) but without that, I would need to do a bunch of !Setvariable, !UpdateMeasure, !OnUpdate stuff to get that to work, which is not ideal.
Is there any chance of getting the !move bang to recognize the AnchorX/Y setting? And while I'm begging for things, a !SetAnchorX/Y bang would also be great.
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:28 pm
by jsmorley
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:33 pm
by Ashtefere
Won't work in my instance, as the X position I need is dynamic at any time, and the width of the meter is dynamic at any time. I will use the !SetVariable/!UpdateMeasure/!OnUpdate trick in the mean time.
Re: AnchorX/AnchorY Not working at all
Posted: May 20th, 2018, 3:41 pm
by jsmorley
Ashtefere wrote:Won't work in my instance, as the X position I need is dynamic at any time, and the width of the meter is dynamic at any time. I will use the !SetVariable/!UpdateMeasure/!OnUpdate trick in the mean time.
Gotcha.. Ok, well we will look into this.
Re: AnchorX/AnchorY Not working at all
Posted: June 6th, 2018, 12:50 am
by Virginityrocks
I like the skin you're working on. What's its name?