Skip to content

Conversation

minetoblend
Copy link
Contributor

I've copy-pasted this class into nearly 10 projects at this point so I figured it might make a good fit for osu-framework.
Adds a BorderLayoutContainer (inspired by java swing's BorderLayout) which will layout it's children along each edge.

2025-06-28.14-07-05.mp4

@minetoblend minetoblend force-pushed the feature/border-layout branch from a57bff1 to 9e85e18 Compare June 28, 2025 12:42
@peppy peppy self-requested a review June 29, 2025 16:09
@peppy
Copy link
Member

peppy commented Jun 29, 2025

This looks like something which could replace some of our usage of grid / flow containers.

One area that I'm not sure about is currently if you set any of the side containers to relative sizing in their direction-towards-main-container everything falls apart. At very least, this should be guarded against.

@peppy peppy removed their request for review June 29, 2025 16:16
@minetoblend
Copy link
Contributor Author

minetoblend commented Jun 30, 2025

This looks like something which could replace some of our usage of grid / flow containers.

That's the main use case I had in mind for it, one other notable thing that comes to mind is stuff like the editor class which kinda does the same setup as this class but manually for positioning the top/bottom bars & the content in-between.

One area that I'm not sure about is currently if you set any of the side containers to relative sizing in their direction-towards-main-container everything falls apart. At very least, this should be guarded against.

Having relative sizes work with this be very handy but I can't quite figure out a good way of making that work, so I guess guarding against it like you said is probably the best option. Should such a guard be a simple runtime check that throws like how FillFlowContainer does in regards to automatic sizing & anchor/origin?

@peppy
Copy link
Member

peppy commented Jun 30, 2025

Runtime check is the best we can do, so I think it's fine as a starting point.

@minetoblend minetoblend force-pushed the feature/border-layout branch from 7e7c5c2 to 7ac49fc Compare June 30, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants