Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: centering posiiton of multiple elements? #61

Open
BeyondMagic opened this issue Apr 15, 2022 · 3 comments
Open

Question: centering posiiton of multiple elements? #61

BeyondMagic opened this issue Apr 15, 2022 · 3 comments

Comments

@BeyondMagic
Copy link
Contributor

BeyondMagic commented Apr 15, 2022

I am using this type of positioning for some time now, but still confused at some things, for example this:

image

Usingo parent_anchor: BR, self_anchor: TR to have space downside and centering works for one -- however, when after adding other action labels with parent_anchor: MR, self_anchor: ML to the right, the parent doesn't count the new space to center horizontally.

I tried with multiple settings, a few go inside other elements, others straight go beyond the geometry of the notification. Is there any way to do this that I don't understand?

Whole config: https://github.com/BeyondMagic/MaGiCK/blob/main/.config/wired/wired.ron

@Toqozz
Copy link
Owner

Toqozz commented Apr 16, 2022

Neat config, looks great!

This is technically possible with creative use of render criteria, but not at all ergonomic.

Basically, as long as you're able to get the blocks in the right positions for a certain number of actions, you can use render criteria to create different "sets" which just choose the layout based on that criteria. Obviously this gets pretty unwieldy pretty quickly. It's also a bit of a puzzle to figure out with variable width buttons -- for 1 action, you want the button to anchor MM->MM, but for 2 you want TR->MM and TL->MM, etc.

I've thought a bit about this and I think the best solution is probably to have some kind of "container" block which basically just grows to the size of all its children and then you can use that for positioning. It's just a bit difficult to implement so I haven't gotten around to it yet.

@BeyondMagic
Copy link
Contributor Author

Understanble, thanks for the detailed response.

@Toqozz
Copy link
Owner

Toqozz commented Apr 16, 2022

Reopening so I remember to work on this :)

@Toqozz Toqozz reopened this Apr 16, 2022
@BeyondMagic BeyondMagic changed the title question: centering horizontally labels? Question: centering posiiton of multiple elements? Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants