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

Fix broken layout of asset library page #88761

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

eugene87222
Copy link
Contributor

@eugene87222 eugene87222 commented Feb 24, 2024

While reviewing #87407, I came across two additional problems. I've recorded a demo to help explain.

2024-02-24.19-00-55.mp4

The first issue, as described in #87407, occurs when horizontally scaling the project manager window while on the asset library page, resulting in a broken layout.
image

The second issue occurs when scaling to the point where the third column appears. It becomes evident that the widths of the three columns are not evenly distributed.
image

The third issue occurs when navigating to the asset library page after opening a project and then scaling. As the number of columns in the asset library increases, it becomes impossible to reduce the number of columns. Even attempting to narrow the width of the asset library doesn't work.

My current solution involves fine-tuning the size of asset_items_columns_width and performing a clamp operation each time _update_asset_items_columns is executed.

Below is the demo video of my solution.

2024-02-24.19-04-15.mp4

Also, I noticed a refactor todo item in the clamp_width function. However, I found that refactoring the LinkButton to support ellipsing functionality similar to Button might not be straightforward for me. I'm also unsure if it would cause some spec changes for LinkButton, so I haven't tackled it from that angle.

Bugsquad edit:

@KoBeWi
Copy link
Member

KoBeWi commented Feb 29, 2024

I think column problems can also be solved by using HFlowContainer instead of GridContainer, no?

@eugene87222
Copy link
Contributor Author

I see. I'll try it.

@eugene87222
Copy link
Contributor Author

image
Seems not. HFlowContainer only stacks items horizontally, without guaranteeing vertical alignment.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 28, 2024

You could try using EXPAND flag on library items, it might force them to have the same size. Though it will break on rows with less items 🤔

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the GridContainer works alright and this fixes the issue.

@akien-mga akien-mga merged commit 2c65bf0 into godotengine:master Apr 4, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 4, 2024
@eugene87222 eugene87222 deleted the fix-asset-lib-layout branch April 5, 2024 08:52
@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot Project Manager Layout is broken when trying to access asset library.
4 participants