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

Support variable-height rows. #136

Merged
merged 9 commits into from
May 18, 2023
Merged

Support variable-height rows. #136

merged 9 commits into from
May 18, 2023

Conversation

grokys
Copy link
Member

@grokys grokys commented Oct 20, 2022

Adds support for variable-height rows, and adds a Wikipedia example to the sample app to demonstrate.

Ports the virtualization algorithm from Avalonia's VirtualizingStackPanel.

Fixes #43

@grokys grokys changed the title WIP: Support variable-height rows. MVP of support for variable-height rows. Oct 21, 2022
@grokys grokys marked this pull request as ready for review October 21, 2022 07:26
@SCLDGit
Copy link

SCLDGit commented Oct 21, 2022

Scrolling with mousewheel seems to not be so happy when trying to scroll up from the bottom of the tree

Copy link
Member

@jmacato jmacato left a comment

Choose a reason for hiding this comment

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

Scrolling up to down is quite smooth! Although going in the opposite direction is jittery as @SCLDGit said

@grokys
Copy link
Member Author

grokys commented Dec 8, 2022

Yeah we need to adjust how ScrollBar works a to fix the jittery scrolling. Currently I managed to make scrolling down smooth but scrolling up is jittery as said. To make it smoother we either need:

  • A way to get the "raw" delta from the scrollbar, so we can tell if the user is scrolling up or down (at the moment it's impossible due to the fact the offset changes along with the extent/viewport so a scroll up can look like a scroll down)
  • For ScrollBar to use the absolute delta from the point that scrolling began instead of from it's current position

Either way, I think it's going to need changes to Avalonia itself.

@grokys
Copy link
Member Author

grokys commented May 11, 2023

VirtualizingStackPanel in the main Avalonia repository was based on the initial work here, but has been greatly improved. I need to take the changes to the algorithm in VirtualizingStackPanel and update this PR.

@grokys
Copy link
Member Author

grokys commented May 18, 2023

Ok, this PR should now be ready. Scrolling is now smooth, though the scrollbar jerks about as with Avalonia's virtualization implementation. We'll need to implement better height estimation as discussed in AvaloniaUI/Avalonia#10892 but this should be quite usable now.

@grokys grokys changed the title MVP of support for variable-height rows. Support variable-height rows. May 18, 2023
@maxkatz6 maxkatz6 merged commit c926418 into master May 18, 2023
5 checks passed
@maxkatz6 maxkatz6 deleted the feature/variable-height branch May 18, 2023 23:08
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

Successfully merging this pull request may close these issues.

TreeDataGrid gets stuck when a row with multiline text is added
4 participants