Make Auto Hide Side Bar React Correctly To Scroll Events#854
Open
Deception666 wants to merge 1 commit into
Open
Make Auto Hide Side Bar React Correctly To Scroll Events#854Deception666 wants to merge 1 commit into
Deception666 wants to merge 1 commit into
Conversation
- the scroll wheel operation only worked between the tabbed buttons and not when the mouse was on the auto hide tab button. since the auto hide side bar already had event filters applied to the auto hide tab buttons, a filtered event of the mouse wheel is redirected to be handled by the auto hide side bar class itself. - the auto hide side bar class now handles the wheel event to correctly handle the direction the auto scroll should take. previously, when the scroll operation was performed on a vertical auto hide side bar, the scroll operation with no keyboard modifiers would scroll vertically as expected. when a scroll operation was performed on a horizontal auto hide side bar, the scroll operation would still move the viewport vertically. this change now detects the orientation of the auto hide side bar to correctly apply the mouse wheel operation. - the alt key will no longer have any effect. when the alt key was held during the scroll operation, the opposite scroll operation was performed. if alt is detected, the x and y angle deltas are just swapped to perform the correct scroll operation. - validated the following combinations: * Windows 11 Qt6 x86_64 * Windows 11 Qt5 x86_64 * Kubuntu 25.10 Qt6 Wayland x86_64
There was a problem hiding this comment.
Pull request overview
This PR improves auto-hide sidebar scrolling behavior by ensuring mouse wheel events over auto-hide tab buttons are handled by the sidebar scroll area and by normalizing wheel axis handling based on sidebar orientation, while neutralizing platform “Alt swaps wheel axis” behavior.
Changes:
- Added a
wheelEvent(QWheelEvent*)override inCAutoHideSideBar(guarded byQT_CONFIG(wheelevent)) to normalize wheel delta orientation. - Updated the sidebar’s tab-button
eventFilterto forwardQEvent::Wheelevents to the sidebar for consistent scrolling when hovering tabs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/AutoHideSideBar.h | Declares a wheel event override (Qt feature-guarded) for consistent auto-hide sidebar scrolling behavior. |
| src/AutoHideSideBar.cpp | Forwards wheel events from tab buttons to the sidebar and normalizes wheel deltas based on orientation/Alt behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+448
to
+457
| QPoint AngleDelta = e->angleDelta(); | ||
|
|
||
| // completely ignore the effects if the alt key is being held | ||
| // if alt is held on a vertical scroll area, cancel the applied horizontal scroll by forcing a vertical scroll | ||
| // if alt is held on a horizontal scroll area, cancel the applied vertical scroll by forcing a horizontal scroll | ||
| if (!d->isHorizontal() && (e->modifiers() & Qt::KeyboardModifier::AltModifier) || | ||
| d->isHorizontal() && (~e->modifiers() & Qt::KeyboardModifier::AltModifier)) | ||
| { | ||
| AngleDelta = e->angleDelta().transposed(); | ||
| } |
Comment on lines
+450
to
+452
| // completely ignore the effects if the alt key is being held | ||
| // if alt is held on a vertical scroll area, cancel the applied horizontal scroll by forcing a vertical scroll | ||
| // if alt is held on a horizontal scroll area, cancel the applied vertical scroll by forcing a horizontal scroll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the scroll wheel operation only worked between the tabbed buttons and not when the mouse was on the auto hide tab button. since the auto hide side bar already had event filters applied to the auto hide tab buttons, a filtered event of the mouse wheel is redirected to be handled by the auto hide side bar class itself.
the auto hide side bar class now handles the wheel event to correctly handle the direction the auto scroll should take. previously, when the scroll operation was performed on a vertical auto hide side bar, the scroll operation with no keyboard modifiers would scroll vertically as expected. when a scroll operation was performed on a horizontal auto hide side bar, the scroll operation would still move the viewport vertically. this change now detects the orientation of the auto hide side bar to correctly apply the mouse wheel operation.
the alt key will no longer have any effect. when the alt key was held during the scroll operation, the opposite scroll operation was performed. if alt is detected, the x and y angle deltas are just swapped to perform the correct scroll operation.
validated the following combinations: