Skip to content

Improved tab bar scrolling #678

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

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

Servall4
Copy link

Remove custom wheelEvent handler. Default QAbstractScrollArea wheel handler seems to work better on platforms like MacOS.

Before:

ads_impl-Untitled.MPEG-4.mp4

due to hardcoded step value, it is very difficult to scroll to the desired tab

After:

qt_impl-Untitled.MPEG-4.mp4

@githubuser0xFFFF
Copy link
Owner

Thank you for your pull request. If I merge the request,, then scrolling the tabs via mouse wheel does not work anymore on Windows with Qt 6.5.2.

@githubuser0xFFFF
Copy link
Owner

I just pushed a branch improved_tabbar_scroll with improved wheelEvent function. Please test, if this improves scrolling on Mac for you.

@Servall4
Copy link
Author

Servall4 commented Dec 5, 2024

Yes, scrolling has become much smoother on the touchpad, but it now works on the Y axis, which is unusual for a touchpad.

@Servall4
Copy link
Author

Servall4 commented Dec 5, 2024

Apparently, the Qt implementation does not assume scrolling of the horizontal scrollbar along the Y axis, this is why scrolling didn't work for you. So we can cheat and send this wheelEvent directly to horizontal scrollbar with this code in CDockAreaTabBar::wheelEvent():
QCoreApplication::sendEvent(horizontalScrollBar(), Event);
Similar logic is implemented in the Qt source code.
Can you test updated code, please?

@githubuser0xFFFF
Copy link
Owner

The code works now. I will merge your pull request. Thank you.

@githubuser0xFFFF githubuser0xFFFF merged commit 1f21eb0 into githubuser0xFFFF:master Dec 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants