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.
It is currently April 24th, 2024, 11:57 pm
AnchorX/AnchorY Not working at all
-
- Posts: 7
- Joined: December 13th, 2017, 9:42 am
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: AnchorX/AnchorY Not working at all
Need to know what you are trying to accomplish. AnchorX and AnchorY certainly work, but are used in conjunction with WindowX and WindowY.
-
- Posts: 7
- Joined: December 13th, 2017, 9:42 am
Re: AnchorX/AnchorY Not working at all
I just checked again.
What doesnt work:
Rainmeter.ini
Skin Bang
or
This results in:
What does work:
This results in:
I would assume that the !Move bang will move the skin by it's anchor. Is this not the intended behavior?
What doesnt work:
Rainmeter.ini
Code: Select all
AnchorX=50%
AnchorY=50%
Code: Select all
[!Move "#WORKAREAWIDTH#/2" "#WORKAREAHEIGHT#/2" targetSkin]
Code: Select all
[!Move "50%" "50%" targetSkin]
What does work:
Code: Select all
AnchorX=50%
AnchorY=50%
WindowX=50%
WindowY=50%
I would assume that the !Move bang will move the skin by it's anchor. Is this not the intended behavior?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: AnchorX/AnchorY Not working at all
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:
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.
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
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: AnchorX/AnchorY Not working at all
Here is a trick that isn't commonly known...
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].
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
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].
-
- Posts: 7
- Joined: December 13th, 2017, 9:42 am
Re: AnchorX/AnchorY Not working at all
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.
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.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
-
- Posts: 7
- Joined: December 13th, 2017, 9:42 am
Re: AnchorX/AnchorY Not working at all
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.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: AnchorX/AnchorY Not working at all
Gotcha.. Ok, well we will look into this.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.
-
- Posts: 478
- Joined: February 26th, 2011, 10:22 pm
Re: AnchorX/AnchorY Not working at all
I like the skin you're working on. What's its name?