-
Notifications
You must be signed in to change notification settings - Fork 80
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
GridSplitter with '1*'-<sized>-<sized> columns does not resize as expected #339
Comments
Thanks for the detailed report @abdes and offering to dig in more, a good place to start debugging is probably in these methods here: https://github.com/CommunityToolkit/Windows/blob/main/components/Sizers/src/GridSplitter/GridSplitter.Events.cs Could be something with getting the right column and bounds checks, or could be something with the logic of determining if the column is resizable? Would have suspected for us to see this before, but I think normally there's usually a single grid-splitter in a two-column setup, so probably why we haven't seen it before. Thanks, I've assigned this to you for now, let us know if you need any help! |
The problem is indeed in the way the GridSplitter decides how to resize the current and sibling columns. When both are not In a scenario with only 2 items and a splitter, this does not show, because the delta gets automatically applied by the grid layout to the sibling. If you look at the code at Windows/components/Sizers/src/GridSplitter/GridSplitter.Events.cs Lines 53 to 74 in f9ce94a
We can see that the method bails out immediately after changing the first row with fixed size (same applies to @michael-hawker I submitted a PR with a fix, please check it. |
Fixes CommunityToolkit#339 If the vector contains another item with Star sizing, it's not enough to just change current. The change will flow to the Star sized item and not to the sibling if the sibling is fixed-size. We need to explicitly apply the change to the sibling.
Fixes CommunityToolkit#339 If the vector contains another item with Star sizing, it's not enough to just change current. The change will flow to the Star sized item and not to the sibling if the sibling is fixed-size. We need to explicitly apply the change to the sibling.
Fixes CommunityToolkit#339 If the vector contains another item with Star sizing, it's not enough to just change current. The change will flow to the Star sized item and not to the sibling if the sibling is fixed-size. We need to explicitly apply the change to the sibling. Now also checks the constraints before allowing the resize.
But, you expect two columns to resize, while they are both fixed sizes. That's a contradictory design. |
There is no such thing as fixed size with splitters. There is ‘star-sized’,
minimum and maximum size and the actual current size. The whole purpose in
life of a resizer is to resize stuff. So, if you don’t want resizing, then
you don’t place a splitter. If you place one, then you do want resizing, and
you want it applied as long as it does not break the constraints.
|
Fixes #339 If the vector contains another item with Star sizing, it's not enough to just change current. The change will flow to the Star sized item and not to the sibling if the sibling is fixed-size. We need to explicitly apply the change to the sibling.
Fixes #339 If the vector contains another item with Star sizing, it's not enough to just change current. The change will flow to the Star sized item and not to the sibling if the sibling is fixed-size. We need to explicitly apply the change to the sibling. Now also checks the constraints before allowing the resize.
Describe the bug
"CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.240109"
Consider a grid with 3 columns and 2 splitters as following:
Splitter at Column 1 works fine, but splitter at Column 3 does not resize Column 4 as expected.
Steps to reproduce
Run the attached sample.
GridSplitterBug.zip
Expected behavior
Given that the splitter is configured to resize PreviousAndNext, it is supposed to resize both columns.
Screenshots
GridSplitter.Bug.2024-02-19.222346.mp4
Code Platform
Windows Build Number
Other Windows Build number
Any version of windows
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
latest
Device form factor
Desktop
Additional context
Help us help you
Yes, I'd like to be assigned to work on this item.
The text was updated successfully, but these errors were encountered: