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

Make v and h panels behave like expected #2599

Open
xxSeys1 opened this issue May 14, 2024 · 1 comment
Open

Make v and h panels behave like expected #2599

xxSeys1 opened this issue May 14, 2024 · 1 comment
Labels
bug Something isn't working ui
Milestone

Comments

@xxSeys1
Copy link

xxSeys1 commented May 14, 2024

Issue description:

I will be making a lot of references to how Godot does it's control/ ui system here. Godot calls their panels "containers", so everytime I write container think of a panel in flax.

I tried uploading this video to Github but it's too large :/ A video is best to explain this cause ui is smth visual.

https://drive.google.com/file/d/1F9treXpsS_tE-kIW2kKwroeAEUGWoDFj/view?usp=sharing

A thing I forgot to show in the video is that Godot has an enum to set where the child controls of a panel center around:
image
image
image

Also this is what happens when you put a vertical panel in a horizontal panel:

https://drive.google.com/file/d/14hz4YYsW8lWNyLsoYt6ygL7dPXtUH1PW/view?usp=sharing

This is so fundamentally broken I don't even know what's happening.
Here is what Godot does when u add the same control layout:
image

Steps to reproduce:

See video

Minimal reproduction project:

none

Flax version:

1.8.1

@mafiesto4 mafiesto4 added bug Something isn't working ui labels May 16, 2024
@mafiesto4 mafiesto4 added this to the 1.9 milestone May 16, 2024
@mafiesto4
Copy link
Member

I see a list of improvements to be done to make this work right:

  • Add AutoWidth, AutoHeight and AutoFitText options to Button (similar to Label) to allow easy text-size handling (both ways).
  • Add Alignment to V/H panels (reuse TextAlignment enum with Near/Center/Far options) to define panel contents placement, Controls added to v/h panels can already use anchors to be placed on start/end of panel area.
  • Add maintaining min size of v/h panels based on children sizes before layout (ideally introduce the concept of MinSize into Control interface for better layout calculations).
  • Fix that vertical panel arrangement with nested horizontal panel and 2 controls. Probably AutoSize is messing with those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui
Projects
None yet
Development

No branches or pull requests

2 participants