Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions phlib/extlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,28 @@ LRESULT CALLBACK PhpExtendedListViewWndProc(
context->WindowDpi = listviewDpi;
}
break;
case WM_MOUSEWHEEL:
{
if (LOWORD(wParam) & MK_SHIFT)
{
SHORT wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
ULONG wheelScrollChars;

if (!PhGetSystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &wheelScrollChars, 0))
wheelScrollChars = 3;

LONG charsToScroll = (LONG)wheelScrollChars * -wheelDelta / WHEEL_DELTA;
LONG count = charsToScroll < 0 ? -charsToScroll : charsToScroll;

for (LONG i = 0; i < count; i++)
{
SendMessage(WindowHandle, WM_HSCROLL, charsToScroll > 0 ? SB_LINERIGHT : SB_LINELEFT, 0);
}

return 0;
}
}
break;
}

return CallWindowProc(oldWndProc, WindowHandle, WindowMessage, wParam, lParam);
Expand Down
2 changes: 2 additions & 0 deletions phlib/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -5629,7 +5629,9 @@ LRESULT CALLBACK PhpThemeWindowACLUISubclassProc(
switch (uMsg)
{
case WM_VSCROLL:
case WM_HSCROLL:
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
InvalidateRect(WindowHandle, NULL, FALSE);
break;
case WM_NOTIFY:
Expand Down
8 changes: 6 additions & 2 deletions phlib/treenew.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,8 +2023,12 @@ VOID PhTnpOnMouseWheel(
)
{
// The normal mouse wheel can affect both the vertical scrollbar and the horizontal scrollbar,
// but the vertical scrollbar takes precedence.
if (Context->VScrollVisible)
// but the vertical scrollbar takes precedence unless the Shift key is held for horizontal scrolling.
if ((VirtualKeys & MK_SHIFT) && Context->HScrollVisible)
{
PhTnpProcessMouseHWheel(Context, -Distance);
}
else if (Context->VScrollVisible)
{
PhTnpProcessMouseVWheel(Context, -Distance);
}
Expand Down
Loading