wired-notify icon indicating copy to clipboard operation
wired-notify copied to clipboard

Question: centering posiiton of multiple elements?

Open BeyondMagic opened this issue 2 years ago • 3 comments

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

BeyondMagic avatar Apr 15 '22 14:04 BeyondMagic

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.

Toqozz avatar Apr 16 '22 03:04 Toqozz

Understanble, thanks for the detailed response.

BeyondMagic avatar Apr 16 '22 05:04 BeyondMagic

Reopening so I remember to work on this :)

Toqozz avatar Apr 16 '22 06:04 Toqozz