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

Add smooth scrolling behavior to settings panels and DecompilerTextView #3244

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

tom-englert
Copy link
Contributor

supersedes #3234 by @SlimeNull; code has been cleaned up and moved to TomsToolbox

@christophwille
Copy link
Member

@SlimeNull @ltrzesniewski everyone happy with this?

@ltrzesniewski
Copy link
Contributor

I like it, it works nice! Thanks @tom-englert for adding it to your toolbox. 🙂

I tried to add the new behavior to the AssemblyTreeView component (for consistency), and didn't spot any difference. I ran the debugger, and noticed the following line gets executed and changes the duration to a very small value (0.01 sec):

duration = new(TimeSpan.FromTicks((long)(duration.TimeSpan.Ticks * absDiff / Mouse.MouseWheelDeltaForOneLine)));

This line isn't executed for AvalonEdit, as if (absDiff < Mouse.MouseWheelDeltaForOneLine) is false. absDiff is 120 for AvalonEdit, but only 6.9 for the tree view.

I'm not sure what to do about this but it's not a blocker I suppose.

@tom-englert
Copy link
Contributor Author

@ltrzesniewski it has no visual effect if the VirtualizingPanel.ScrollUnit is Item, which is the default for e.g. ListBox and probably also the TreeView.
I tried to change the scroll unit to Pixel, but the visual experience is much worse even with the smooth animation, so I did not investigate further.
However maybe it makes sense to use it also for the tree view to improve the touch pad experience?

@ltrzesniewski
Copy link
Contributor

Oh ok I see, I've also had bad experience with Pixel in the past, so I suppose it's better to leave it as-is indeed.

I can't really comment on the touchpad though.

@christophwille
Copy link
Member

I am going to merge the PR at this point in time, should further improvements / changes come up, we'll handle that with another PR.

@christophwille christophwille merged commit a8eeed1 into icsharpcode:master Jul 29, 2024
5 checks passed
@SlimeNull
Copy link

@tom-englert I have a question, why am I not in the list of contributors? It doesn't matter if it's ILSpy or TomsToolbox. 🤓👆

@tom-englert
Copy link
Contributor Author

I'm just a simple contributor, I don't manage this project.

@christophwille
Copy link
Member

"and moved to TomsToolbox" - that would mean a mention would be in order there.

@SlimeNull
Copy link

I also think so, at the very least, there should be "original code source" in the code, or my name.

@fawdlstty
Copy link

I'm just a simple contributor, I don't manage this project.

You should fork from @SlimeNull's repository and do work so that everyone who contributed to the project can get the credit they deserve

@christophwille
Copy link
Member

I'm just a simple contributor, I don't manage this project.

You should fork from @SlimeNull's repository and do work so that everyone who contributed to the project can get the credit they deserve

this is not a free-for-all discussion thread.

@tom-englert
Copy link
Contributor Author

@fawdlstty forking is not an option, since the final solution has not too much in common with the original one

@SlimeNull If you like to be listed, I'd suggest to add a comment with the link to your project here https://github.com/tom-englert/TomsToolbox/blob/master/src/TomsToolbox.Wpf/Interactivity/AdvancedScrollWheelBehavior.cs. If you do it as a PR, you'll be also automatically listed as a contributor.
Also maybe add some links to your own sources, since the basic principle of using an animation has been described earlier in several articles, e.g. on Stack Overflow e.a.

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.

5 participants