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

Tree view scrolling and scrollbars is buggy #10

Open
nyanpasu64 opened this issue Oct 16, 2021 · 1 comment
Open

Tree view scrolling and scrollbars is buggy #10

nyanpasu64 opened this issue Oct 16, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@nyanpasu64
Copy link

Setup: Install Cargo UI 0.2.0 using cargo install cargo-ui or checking out master (38ca410) and cargo run [--release]. Click "Show Dependencies".

I'm on Linux using a clicky non-continuous wheel mouse.

Stale scrollbar size

If you scroll with the mouse wheel and change the width of the widest visible row, the width of the horizontal scrollbar doesn't update (remaining 1 scroll behind) until you drag the vertical scrollbar, or scroll again (which updates the scrollbar width to the previous widest visible element, again remaining 1 scroll behind).

Similarly, if you expand or contract a tree element, the scrollbar size doesn't update until you scroll the wheel or drag a scrollbar.

(On 0.2.0, the scrollbar size always corrects itself in half a second. On git master, the scrollbar doesn't correct itself until you explicitly scroll.)

Scroll past end

If you drag the scrollbar to the end of the list, then wheel up and down, you end up 16 pixels or so below the end of the list. Scrolling down again puts you below the end of the list. Dragging the scrollbar doesn't cause these issues. (This occurs on master, not 0.2.0.)

Scroll position not clamped in-bounds on content changes

Collapsing a tree view element can cause the scroll position to show white space. Dragging the scrollbar (even horizontal) causes the page to scroll up to hide the white space (as long as it doesn't expose white space above the first element).

@ogoffart
Copy link
Member

Thanks for reporting the bug!

One problem is that the item of the treeview have different height depending if they have a button or not. And this causes a bunch of problem when scrolling because we don't create all the items so we don't know the total height. I've tried to mitigate most problem in slint-ui/slint@e3d9abb

Then the other problem is that there is a stale scrollbar. This happens because of the design of the ListView which needs to be fixed. I filled an issue in the sixtyfps repository: slint-ui/slint#602

@ogoffart ogoffart added the bug Something isn't working label Oct 21, 2021
ogoffart added a commit to slint-ui/slint that referenced this issue Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants