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

Fix scroll bar position from jumping back to the top #984

Merged

Conversation

roulaoregan-spi
Copy link
Contributor

Summarize your change.
A common minor annoyance we heard from our users is that when scrolling through many jobs (500+), as they scrolled down the list and double clicked on a job to see it's layers, the scroll bar would jump back up to the top, forcing the user to re-scroll back down the list if they needed to view the other jobs in that scope, ideally the scroll position should remain in the most recent position.
Solution: Changed scroll position using the setVerticalBar().setRange(...) and created a small scroll area between scroll position and the number of jobs monitored.

@@ -435,7 +435,7 @@ def _processUpdate(self, work, rpcObjects):
if proxy in self.__userColors:
self._items[proxy].setUserColor(self.__userColors[proxy])

self.verticalScrollBar().setValue(scrolled)
self.verticalScrollBar().setRange(scrolled, len(jobObjects.keys() - scrolled))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lint check is failing with:

cuegui/JobMonitorTree.py:438:60: E0602: Undefined variable 'jobObjects' (undefined-variable)

Should that be rpcObjects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct, thanks for spotting that (was an older change I was porting over and missed that!) Thanks so much. Also I missed the line you highlighted in the logs (thanks again for that). I'll update the code

@bcipriano
Copy link
Collaborator

Ping here, looks like this should be ready to merge soon.

Changed scroll position using the setVerticalBar()
.setRange(...) and created a small scroll area between
scroll position and the number of jobs monitored.
@roulaoregan-spi
Copy link
Contributor Author

@bcipriano - committed the changes to fix the failure, looks like the pipeline now passes.

@bcipriano bcipriano merged commit 02456f5 into AcademySoftwareFoundation:master Jul 29, 2021
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.

2 participants