It is currently August 8th, 2020, 11:34 pm

[Feature Suggestion] Possibility to use modifiers in move bang

Report bugs with the Rainmeter application and suggest features.
User avatar
Nickson
Posts: 8
Joined: May 10th, 2020, 7:02 pm

[Feature Suggestion] Possibility to use modifiers in move bang

Post by Nickson »

I stumbled upon the move bang to center my skins.

In here it says, you can use the %, R, B modifiers for the WindowX and WindowY position.

But its not possible to use these modifiers in the move bang, but it would be nice when you can.

As example I use this bang to center a skin:
[!Move "(#WORKAREAWIDTH# / 2 - #CURRENTCONFIGWIDTH# / 2)" "(#WORKAREAHEIGHT# / 2 - #CURRENTCONFIGHEIGHT# / 2)" "#CURRENTCONFIG#"]

With the change it would be possible to shorten it like that:
[!Move "(50% - #CURRENTCONFIGWIDTH# / 2)" "(50% - #CURRENTCONFIGHEIGHT# / 2)" "#CURRENTCONFIG#"]
Last edited by Nickson on June 25th, 2020, 8:06 pm, edited 1 time in total.
User avatar
Brian
Developer
Posts: 2044
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Feature Suggestion] Possibility to use modifiers in move bang

Post by Brian »

Nickson wrote:
May 14th, 2020, 3:11 am
With the change it would be possible to shorten it like that:
[!Move "(50% - #CURRENTCONFIGWIDTH# / 2)" "(50% - #CURRENTCONFIGHEIGHT# / 2)" "#CURRENTCONFIG#"]
I just want to point out that the modifiers %, R, B need to be trailing. The 50% portion of your example bang would be invalid since it not accepted currently with WindowX/Y.
https://docs.rainmeter.net/manual/settings/skin-sections/#WindowXY

Having said that, this is something we can look at. It's just a matter of parsing, and we can re-use the same parsing that we use for WindowX/Y.

We will discuss this.

-Brian

PS - Glancing at the code in question, I discovered a bug with our current parsing of WindowY, and an inconsistency with the AnchorX/Y options (they don't support the B modifier). Although that might be just a documentation issue.
User avatar
Jeff
Posts: 145
Joined: September 3rd, 2018, 11:18 am

Re: [Feature Suggestion] Possibility to use modifiers in move bang

Post by Jeff »

If this is really looked at, will a bang related to changing the anchor also be made, or will we have to do it with DefaultAnchorN?
Maybe I shouldn't have been so blunt when I made fun of !Move only using pixels here...
User avatar
Nickson
Posts: 8
Joined: May 10th, 2020, 7:02 pm

Re: [Feature Suggestion] Possibility to use modifiers in move bang

Post by Nickson »

Is there any progress?
User avatar
Brian
Developer
Posts: 2044
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Feature Suggestion] Possibility to use modifiers in move bang

Post by Brian »

Unfortunately, due to some parsing issues, we could not add the use of "modifiers" to the !Move bang. The main reason is the !Move bang moves the skin first, and then calculates the screen coordinates back to the WindowX/Y values in the settings file. It accounts for the AnchorX/Y values after it already moved the skin. This created a problem after the skin was reloaded.

But...

We have added 2 new bangs!
!SetAnchor and !SetWindowPosition

Usage: (bold items are required, italicized items are optional)
  • !SetAnchor AnchorX AnchorY Config
  • !SetWindowPosition WindowX WindowY Config
  • !SetWindowPosition WindowX WindowY AnchorX AnchorY Config
Both bangs accept their appropriate modifiers. Both bangs will update the skin's position.
The main difference between these and !Move is the bangs will set WindowX/Y and/or AnchorX/Y before moving the skin. This would be the equivalent to manually changing those values in the settings file and then refreshing the skin.

You can now center a skin on the fly with: [!SetWindowPosition "50%" "50%" "50%" "50%"]

8-)

Note: This doesn't deprecate the !Move bang. While you can use !SetWindowPosition (without any modifiers) to move a skin, !Move is still recommended.

-Brian

PS - The modifier parsing issues with WindowY and AnchorX/Y have been fixed.
User avatar
Nickson
Posts: 8
Joined: May 10th, 2020, 7:02 pm

Re: [Feature Suggestion] Possibility to use modifiers in move bang

Post by Nickson »

Oh that's super cool, I will test them out!