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

Can't get Grid sizing scopes to work in FuncUI #443

Open
marklam opened this issue Dec 19, 2024 · 7 comments
Open

Can't get Grid sizing scopes to work in FuncUI #443

marklam opened this issue Dec 19, 2024 · 7 comments

Comments

@marklam
Copy link
Contributor

marklam commented Dec 19, 2024

I've made a sample repo at https://github.com/marklam/GridSizingScopes

The sample code from https://docs.avaloniaui.net/docs/reference/controls/grid/sharedsizegroup is replicated in F# in the XamlGrids project.

An attempt to recreate this in FuncUI is in the FuncUIGrids project.

The XamlGrids version sizes the groups A, B and C (columns 1, 2 and 4) to their content. The FuncUI version sizes all the columns as if they were of width 1*

XamlGrids:
image

FuncUIGrids:
image

Is there something I'm missing? It doesn't seem like this should be object graph / diff related, but I'm not sure.

@JaggerJo
Copy link
Member

Hey @marklam

interesting bug, after looking at it briefly I don't not see anything obvious. Can take a closer look tomorrow

XAML Version:

image

FuncUI Version:

image

@marklam
Copy link
Contributor Author

marklam commented Dec 19, 2024

Thanks for taking the time to look at it.

Yes, the diagnostics view doesn't give much insight into size scopes, unfortunately.

I pushed a new changeset to make the UI trees match (ItemsControl with ContentPresenter instead of ListBox with ListBoxItem/HostControl) but it doesn't change the sizing.

@JaggerJo
Copy link
Member

Hey @marklam

Did you manage to make any progress by yourself?

@marklam
Copy link
Contributor Author

marklam commented Jan 13, 2025

No luck sadly, @JaggerJo

I had hoed that it was down to the layout hierarchy, but when that didn't fix it, I ended up just picking an adequate-looking fixed size as a workaround.

@JaggerJo
Copy link
Member

@marklam

I'm currently pretty time constrained.. I think this needs a full day of attention as it's not obvious why the exact same layout leads to different behaviour. SharedSizeScope seems to be not heavily used, I can image it containing some edge cases.

Would be interesting if the issue still exists if you create the UI tree in code (not FuncUI, raw F#/C#). Then we could isolate if it's XAML magic that's making it, or FuncUI breaking it 🙃

@edgarfgp
Copy link

Based in what I had to do for Fabulous.Avalonia to support this. I think the logic for Row and Column definitions needs to be updated .

Context: https://github.com/fabulous-dev/Fabulous.Avalonia/pull/273/files

@JaggerJo
Copy link
Member

Hey @edgarfgp 👋

hmm, @marklam also sets SharedSizeGroup columns, see:

https://github.com/marklam/GridSizingScopes/blob/51619b3a6e2ffabedc66985ac8c3c7cb4ea657a6/FuncUIGrids/Program.fs#L42-L47

What am I missing here?

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

3 participants