Skip to content

Make Auto Hide Side Bar React Correctly To Scroll Events#854

Open
Deception666 wants to merge 1 commit into
githubuser0xFFFF:masterfrom
Deception666:auto-hide-scroll-wheel-fix
Open

Make Auto Hide Side Bar React Correctly To Scroll Events#854
Deception666 wants to merge 1 commit into
githubuser0xFFFF:masterfrom
Deception666:auto-hide-scroll-wheel-fix

Conversation

@Deception666

Copy link
Copy Markdown
  • 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

- 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 in CAutoHideSideBar (guarded by QT_CONFIG(wheelevent)) to normalize wheel delta orientation.
  • Updated the sidebar’s tab-button eventFilter to forward QEvent::Wheel events 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 thread src/AutoHideSideBar.cpp
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 thread src/AutoHideSideBar.cpp
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
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.

3 participants